Hi, I have 500+ pages on my Q&A website example.com
on WordPress and I have the Yoast premium plugin
installed and Activated on my WordPress site. The Yoast plugin has generated the sitemap.xml
file and where last modification date
for almost all Questions and the post is old. Why I am mentioning this is that I am noticing a drop in SERP
ranking of my questions post. Earlier the ranking for most of the posts was on 1st page and now it’s no more in the top 100. May be 100+ or unknown to me now.
I was researching it for quite some days and noticed that the Q&A theme Discy
which is built into my website is generating QA schema
on my website by itself for each question page which gets created when someone asks any questions on the site user interface. Now, the worst thing here is the Yoast premium plugin
installed on my WordPress site is also generating the Webpage Article type schema
as well for each page on my site making each page have two schemas
one is Article type
and another is QA type
which is causing conflict
and Google finds it hard to prioritize which schema. Therefore, I have disabled the article schema generated by Yoast
on my site and kept the QA schema
for each page. After this update, the All Questions page was left with only one schema which is the QA schema but since there is no update on the content side of any page, therefore, the last modification date
is still not changed and shows the old date for pages on sitemap.xml
.
I know that I can do this by manually editing and updating each question post either from the WordPress backend or my website user interface which is a tedious and repetitive task and I don’t want to do that on 500+ pages. I am not getting how can I update the last modification date
in Yoast generated sitemap.xml
on all posts at once?
You can follow the below steps to update the
last modification date
for all posts, questions, and pages on your WordPress site
sitemap.xml
at once.Using SQL Query for bulk update:
You can use SQL queries to update the
post_modified
andpost_modified_gmt
fields in theWordPress database
.phpMyAdmin
.modification date
to thecurrent date
andtime
for all posts, pages, and questions on your site.UPDATE wp_posts
This SQL query updates theSET post_modified = NOW(),
post_modified_gmt = UTC_TIMESTAMP()
WHERE post_type in ('post', 'page','question')
AND post_status = 'publish';
post_modified
date, which Yoast uses to generate thetag in your
sitemap
.