-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query loop: Non-inherited queries must also update the document title (potential impact on SEO) #55489
Comments
Worth also mentioning that a Query Loop block with 'Enhanced pagination' can be added also to a normal post or page. In this case, the post or page actually become an archive page with paginated pages. Still, the document title will not change and will always be the same across all paginated pages. Tje URL will change, e.g.:
The document title will stay the same for all paginated pages, e.g.:
|
@afercia I think your last comment conflates two things. It has always been the case that the pagination added on a post / page that uses the query param based pagination doesn't update the page title. So I think there are two issues here. One is a long standing one that you are now finding, and the other is a new introduction with 6.4 and the enhanced pagination. The new issue is that enhanced pagination on archive templates where you use the inherit option doesn't update the document title. |
@fabiankaegy yes that is possible but I would say it's an edge case. Worth improving it though. The main issue here is about the archive pages. With SEO impact still to fully evaluate. |
I see a substantial difference between the situation with classic themes and block-based themes though. Before: Now: |
I don't think I understand where you are drawing the line here. Regardless of whether you are in a block theme or in a classic theme that uses the block editor. You can insert a query block on any post / page in either. Which always has the query parameter based pagination which doesn't update the title. So the issue is the same for all kinds of themes. This issue is fundamental to the Query block. And the addition of "enhanced pagination" doesn't change anything about that. The only difference with block based themes is that you can now also use the query block on archive pages and therefore use that actual |
When I mentioned 'classic' themes and block-based themes, I meant 'classic' as in: the traditional themes where pagination is managed by WordPres stemplating functions and users can't mess with the Query Loop.
I think it doesn't update correctly also wjen As I mentioned, there's also potential SEO concerns here still to be fully evaluated. |
Would be the enhanced pagination issue solved with this PR? |
#55446 solves the accessibility and usability issue. |
I'm not a SEO expert, but I guess when robots access different pages, they do a navigation per page, instead of clicking on the different pagination links. In that case all pages have their own urls and can be crawled, so should not be a problem. |
I'm not an SEO expert so I'm not going to make assumptions about things I'm not 100% familiar with. Anyways, it is important to take into consideration WordPress core has a few filters in place in the code that generates the document title. With Enhanced pagination enabled, these filters will keep returning the value generated via PHP on first page load as expected, but the value will not change when clicking the Enhanced pagination links. Basically these filters won't work and there's no equivalent implementation with Enhanced pagination enabled. Right now, while the document title is updated with the page number, other tags generated by plugins don't get the correct page number as they expect the WP filters to just work. I'd think that at the very least the WordPress 6.4 Field Guid should put this problem in big relevance. |
I have renamed the title since the problem with enhanced pagination was solved in this pull request, and only the issue with non-inherited queries remains, which does not update the title even with enhanced pagination disabled. Moreover, if non-inherited queries modify the page title someday, it will work by default with enhanced pagination because that's just updating the title with whatever is inside the |
Description
Similar to #51579
When implementing an 'in page' navigation à la 'single page app', a few things must always be implemented. Amongst them, a routing mechanism, integration with the browser history API, and announcing navigation occurred to assistive technology.
One more fundamental aspect is that the document title must be updated.
If it isn't updated:
The 'classic' pagiination always adds 'page 2', 'page 3', etc. to the document title:
The 'Enhanced' pagination does not:
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: