Page Title on First Line After Head Opening Tag

I have been looking for a way to have the Page Title show on the first line after <head> tag without much success.

As is with Yii 1.1.x currently the Page Title show below the other meta tags namely description and keyword tags.

I believe it is SEO best practice to have the page title as the first tag.

How do i get the page title to show on top after <head>?

It shouldn’t matter much for SEO to be honest. That aside, simply go in to your layout file (somewhere such as views/layouts/main.php) and look for (or something the variation of):


<title><?= Html::encode($this->title) ?></title>

Move it where you want.

edit: just noticed this was for Yii 1.1. The solution still stands (though you’ll be looking for a slightly different string).

That is already set in /views/layouts/main.php right below the <head> tag. However when you view source from the browser the <title></title> is comes after the meta tags and the jQuery.

I have noticed sites on the 1 SERP have their <title> tags on top. Thats why i am keen on having the <title ></title> appear first.