-
Notifications
You must be signed in to change notification settings - Fork 886
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
Last Mod. column in sitemaps contains wrong data #15801
Comments
Hi @poluhovich and thank you for your detailed report. However, it's kind of unclear what problem this is trying to fix, could you provide a problem description for this solution? |
@Djennez the problem is that "Last Modified" column in the sitemaps contains wrong data, I don't know if it has any impact on SEO: |
Do you have any information on how to recreate wrong data in that column? Because my data seems correct at the moment. |
Hey, i notice same in my sitemap but notice that if I update category or tag it does not chage last mod. Aslo no new categories at all eventhough I cached everything done everthing on their page. |
Please give us a description of what happened.
Source of the issue is in the file:
inc/sitemaps/class-post-type-sitemap-provider.php
:Since that query contains
WHERE
clause for filtering by post_type and post_status, the numeration of rows isn't what is expected.Example of the source query:
In my case that query returns next data (just for example, I will use these date below for searching):
But if we compare with data from the next query, which outputs a number of rows, and search for these dates, we will see that numbers of rows aren't what we expected to see. We expected to see numbers of a row as multiple of 1000 (due to
( @rownum:=@rownum+1 ) % 1000 = 0
) but these numbers are not.Example of SQL query with a number of rows output:
Example of results:
and so on
Solution
The solution is to wrap the whole SQL query into another SQL query and filter results by row number:
and output of
row
column prooves that data is correct now:So, the original code in the mentioned file needs to be next:
The text was updated successfully, but these errors were encountered: