WordPress.org

Ready to get started?Download WordPress

Forums

Adding rel- next and prev and canonical links on paginated pages (2 posts)

  1. morpheus83
    Member
    Posted 11 months ago #

    I am looking to add the following meta tags in the header.
    <link rel="canonical" href="http://mywebsite.com/auto/page/2/"/>
    <link rel="prev" href="http://mywebsite.com/auto/"/>
    <link rel="next" href="http://mywebsite.com/auto/page/3/"/>

    It is easy to add canonical tags on single pages, but a bit tricky for paginated pages.

    Can anyone help me with the code?

  2. Jerry
    Member
    Posted 11 months ago #

    I'm in my tablet so forgive my grammar, but you may want to look at the is_paged conditional

    http://codex.wordpress.org/Function_Reference/is_paged

Reply

You must log in to post.

About this Topic