On a singular post/page, normally in The Loop
post_title; if, however, this needs to be overridden so that a
custom content heading is displayed (i.e. for SEO purposes), then an
h2 element may be supplied at the beginning of
post_content and the contents of this heading element
will be returned by
the_title() instead of
From a technical perspective, the site title in the main header should be
h1 element and the page/post title should in an
element within an
article, per HTML5:
Sections may contain headings of any rank, but authors are strongly
encouraged to either use only `h1` elements, or to use elements of the
appropriate rank for the section’s nesting level.
This is seen in the default WordPress theme and the HTML specifications. However,
SEO places higher priority on the contents of an
h1 element, so if
every page of a site has the exact same
h1 contents (the site name),
then search engines may not be as likely to rank the page based on the unique
contents of the
h2. It has been suggested
therefore that the
h1 and the
h2 elements be swapped,
so that the site title appears in an
h2 and so that the unique page
title appears in the
h1. While the specifications don’t prefer this
arrangement, it is not incorrect, also per HTML5:
Both of the documents are semantically identical and would produce the same
outline in compliant user agents.
So if different heading levels are semantically equivalent, and if search
engines really place that much importance on
h1, then SEO wins.
In both cases, content section headings should be coded with
Technical note: If the
$post object is not passed into
filter, then the page’s
the_title() must be called before every other
Este plugin não tem avaliações.
Contribuidores e programadores
“Override Post Title with First Content Heading” é software de código aberto. As seguintes pessoas contribuíram para este plugin:Contribuidores
Interessado no desenvolvimento?
Registo de alterações
- Restricting first content heading searched for to be either
h2, for SEO purposes.
- Initial release