WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 6 years ago

Last modified 3 years ago

#25336 closed enhancement (wontfix)

Links provided by wp_link_pages() should add rel=next and rel=prev

Reported by: rcoll Owned by:
Milestone: Priority: normal
Severity: minor Version:
Component: Posts, Post Types Keywords: has-patch
Focuses: template Cc:

Description

As the title states, when using wp_link_pages(), we should throw in rel="next" and rel="prev" for good SEO practice. I understand that there are other methods of achieving this but with more complicated sites this becomes very difficult to effectively pull off without breaking other features.

I don't see a reason that we can't roll this into the core, it seems to make sense that anywhere you would use wp_link_pages() should also use these attributes.

I will try to work up a patch at some point.

Attachments (1)

25336.patch (1.6 KB) - added by nofearinc 7 years ago.
Adding a patch for proof of concept

Download all attachments as: .zip

Change History (8)

#1 @SergeyBiryukov
7 years ago

  • Component changed from Accessibility to Template

@nofearinc
7 years ago

Adding a patch for proof of concept

#2 follow-up: @joostdevalk
7 years ago

Not necessarily good for SEO, as Google would want these as <link> elements in the <head> section, but good HTML practice nonetheless, also: I love this type of filter and would love that on each and every link generated by core :)

#3 @nacin
7 years ago

  • Component changed from Template to Posts, Post Types
  • Focuses template added

#4 @obenland
6 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to Future Release

#5 @obenland
6 years ago

Related: #24375.

#6 @obenland
6 years ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Discussed the issue of rel attributes with ocean90 at #wcchh14 contributor day.

As joostdevalk pointed out, adding rel attributes doesn't necessarily help SEO. An article on the Official Google Webmaster Blog even suggests:

rel="next" and rel="prev" only need to be declared within the <head> section, not within the document <body>

Since we already do define these in the head section of applicable documents, this should not be necessary.

Last edited 6 years ago by SergeyBiryukov (previous) (diff)

#7 in reply to: ↑ 2 @inetbizo
3 years ago

Replying to joostdevalk:

Not necessarily good for SEO, as Google would want these as <link> elements in the <head> section, but good HTML practice nonetheless, also: I love this type of filter and would love that on each and every link generated by core :)

Would you agree POSH HTML5 would be

<?php
<aside>
    <nav>
        <h1>Some heading text for nav</h1>
        the links here
    </nav>
</aside>
...
</article>
Last edited 3 years ago by inetbizo (previous) (diff)
Note: See TracTickets for help on using tickets.