Dukeo » WordPress » Improve Pages Titles: Instant Better SEO Results

Improve Pages Titles: Instant Better SEO Results

Steven 3 responses WordPress

Everybody knows that SEO is essential to grow your blog and to gain new visitors from search engines. Here is how to improve your blog pages titles for better SEO.

Open the file header.php from your theme folder. Search for the <title></title> tag and paste the following code:

<title>
<?php if (is_home()) {
  bloginfo('description');
} elseif (is_category()) {
  single_cat_title(); echo ' - '; bloginfo('name');
} elseif (is_single() || is_page()) {
  single_post_title(); echo ' - '; bloginfo('name');
} else {
  wp_title('',true);
} ?>
</title>

This snippet of code will generate better <title> tags for your pages following this model:

  • On the blog homepage, the title will be: the blog description,
  • On category pages, the title will be: the category name – the blog name,
  • On article pages and static pages, the title will be: the page name – the blog name.

If you enjoyed this article,
Get email updates

Join for Free »

3 Comments

  1. Buysellwordpress

    Many thanks for such a useful advice! I will try to check it out soon

    1. You’re welcome ^^

  2. Melissa

    Is it really so simple? Do I need to do something else for this?