WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#36558 closed enhancement (wontfix)

Replace H2 title in posts pagination to div or span

Reported by: webliberty Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.1
Component: Posts, Post Types Keywords: close
Focuses: template Cc:

Description

Function the_posts_pagination() when processing prints the line with the pagination with the title <h2> - from the point of view of SEO this is not good, as auxiliary object must not use titles H. Please consider changing H2 to div or span tag.

Another option is to add to the array of arguments before and after, such as in widgets:

the_posts_pagination( array(
	'before_pagination' => '<div>',
	'after_pagination' => '</div>'
) );

Change History (4)

#1 @Clorith
5 years ago

  • Keywords close added
  • Milestone Awaiting Review deleted

This can actually be overwritten using the navigation_markup_template filter as of 4.4, so I'm not sure adding complexity to the function call it self is needed.

The get_posts_pagination function internally calls _navigation_markup which then contains the filter described.

That would also let you handle it for comment pagination in one go, as seen from https://developer.wordpress.org/reference/functions/_navigation_markup/

IT should be noted that in most cases you will be calling this within The Loop as part of the template where you already have the h1 tag defined and the natural progression is for a new headline above this pagination should be h2 for accessibility reasons.

#2 @SergeyBiryukov
5 years ago

  • Component changed from General to Posts, Post Types
  • Focuses template added
  • Milestone set to Awaiting Review

from the point of view of SEO this is not good, as auxiliary object must not use titles H.

Is there a reliable source that confirms this? I think it's an assumption coming from pre-HTML5 era.

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

#3 @webliberty
5 years ago

Imagine that the title of the site I have concluded in H1. Then I write an post, its name is enclosed in H2.

According to W3C specifications H headers have a certain importance (Source):

These elements have a rank given by the number in their name. The h1 element is said to have the highest rank, the h6 element has the lowest rank, and two elements with the same name have equal rank.

If pagination is used H2 and title of the article is H2, it turns out that both the title equal in importance? And if in the article is further broken down into sub-headings using H3, we get that the most important, they are less relevant than the pagination? This is not true, most importantly on the site - is the content, not the pages of pagination.

See Google Search Engine Optimization Starter Guide - example on the page 20.

Even if we take for example a traditional paper book, you will never find it does not page numbers allocated to the same title and large print, as the title of the chapter.

#4 @joostdevalk
5 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Themes should override this to use the right heading in their structure, the H2 is a default that would work with most themes. It's actually not that much of an SEO issue at all, so I'm going to close as wontfix.

Note: See TracTickets for help on using tickets.