Yoast SEO Title – How to do Title Tags SEO in Yoast SEO Plugin

Recently one of my sites was affected by Google Penguin 3.0 and I was very much disappointed by that. Because it lowered my blog’s traffic up to 70% and my blog was totally down in terms of traffic as well as earning. I thought to recover my blog from Google Penguin 3.0 penalty and hence I have started SEO analysis on my blog. While researching in depth about on-page SEO factors, I have found that updated version of SEO by Yoast was not showing page numbers in meta titles. It means if your category name is a category, it will display only category name in Search results in the title for any page you go.

Page Numbers in Meta Titles in Yoast SEO Plugin

Suppose, if your WordPress blog is example.com and its category is example.com/category. Now all pages for your blog category would be example.com/category/page/3/, example.com/category/page/4/ like that. Its title should be Category name – Page number in meta title. But it was not working. As suggested by Joost de Valk plugin owner, by adding %%page%% variable you can use in your title templates on the SEO -> Titles page that does this without the need for all that code. Also, if you, under SEO -> Indexation, check the first checkbox, to noindex subpages, you won’t have this problem at all.

I have personally tried it my self but it seems not working properly, later I thought to shift to other best SEO plugins. I have tried few of them but did not like them because I was already have worked with Yoast SEO Plugin and it’s very good SEO plugin.Later I have tried few of the tutorial out of which I found a solution to adding page numbers in tags and category pages.

Code suggested by maxbuxfiy was worked well for me.All you have to do is just modify your header.php code where the title for the page is located. Open header.php file from your theme and there you will need to find the following piece of code.

<title><?php wp_title(”); ?></title>

After that, you have to replace that code with following piece of code.

<title><?php wp_title(”); if ( $paged >= 2 || $page >= 2 ) echo ‘ | ‘ . sprintf( __( ‘Page %s’), max( $paged, $page ) ); ?></title>

This will fix & place | Page 2 | page 3 navigation numbers and so on if your post is paginated and will leave the title unchanged on the first page.

Another best solution is suggested by MaxBux seems also working to fix this issue. The code below is from WordPress SEO plugin by Yoast, please note that by adding add the page number to the Meta description on paginated posts you can avoid duplication issues with Google Webmaster Tools.

<?php # -*- coding: utf-8 -*-
/**
 * Plugin Name: T5 Add page number to title
 * Description: Adds <code> | Page $number</code> to the page title.
 * License:     MIT
 * License URI: http://www.opensource.org/licenses/mit-license.php
 */

if ( ! function_exists( 't5_add_page_number' ) )
{
    function t5_add_page_number( $s )
    {
        global $page;
        $paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;
        ! empty ( $page ) && 1 < $page && $paged = $page;

        $paged > 1 && $s .= ' | ' . sprintf( __( 'Page: %s' ), $paged );

        return $s;
    }

    add_filter( 'wp_title', 't5_add_page_number', 100, 1 );
    add_filter( 'wpseo_metadesc', 't5_add_page_number', 100, 1 );
}

If you are using other tips or code to add page numbers in meta titles or description, feel free to share it with seomediaworld readers. If above tutorial was worked and you have successfully added Yoast SEO Title page numbers, feel free to share your feedback about it in the comment section below.

If you don’t want to mess up with your blog’s code and still want to get the things done, you can hire recommended SEO experts online.