About 2 months ago I installed some plugins which had to improve some aspects of my site. I configured them, they were looking great, and I was happy.
Suddenly I realized the dates of the posts started to change. Not all of them at one time, but one by one, from time to time, and at the time when least expected. I made some checks, but as I was quite busy, I left the blog to live by itself. Initially I thought that the post_modified timestamp field from the wp_posts table is changing, probably due to some actions performed by the plugins, the post_date timestamp stayed untouched, and that a plugin has changed the date to be shown on the posts to be date_modified. That continued until today, when I had a more careful look at the wp_posts table. It turned out that the post_date, post_date_gmt, post_modified and post_modified_gmt timestamps are all changing. There was no way to restore the dates from the first sight. I started to get annoyed, and when I get annoyed, I usually fix the things quickly.
I saw the post_date of the last strangely modified article is ‘2011-09-11 07:20:41’. What happened then? I had a look at in the hosting Control Panel the log of the apache. The line was saying
209.85.101.23
|
/wp-cron.php?
doing_wp_cron
|
9/11/11 7:20 AM
|
0
|
![]() |
POST
|
HTTP/1.0
|
WordPress/3.2.1;
http://bulgariaalli
|
So what was in the /wp-cron.php script? I opened the file with an editor. The wp-cron.php was calling the _get_cron_array() function in the line
if ( false === $crons = _get_cron_array() )
The _get_cron_array() was defined in /wp-includes/cron.php file. The first line of that function was
$cron = get_option(‘cron’);
So the only thing left was to open phpMyAdmin and to make a SELECT statement
SELECT * FROM `wp_options` WHERE option_name=”cron”;
The result was somewhat cryptic, but the option_value contained a “pk_stt2_promote_old_post_event_hook” command which looked suspicious to me. I checked the settings of the SEO SearchTerms Tagging 2 plugin. And guess what, there was an option Promote old post with no search engine traffic set to yes. I know I did look at that option when configuring the plugin, but I considered the promotion is done in another way. I set the option to no and I hope I will have no trouble with change of the post date again.
I hope you’ll find this article useful, although it is a bit offtopic for the Bulgaria All Inclusive subject.
BR,
Nikolay
P.S. You may wonder how I restored the original dates.
Luckily for me the WP had saved versions of the posts, so I just had to find their post_date. Let’s suppose the ID of the post was X. I made a query
SELECT * FROM wp_posts WHERE post_parent=X;
. I put the minimal post_date int the line where post ID=X, and there we go, the dates were repaired.
Pingback: How to make Banitsa