Sunday, March 13, 2016

RSS feed doesn't validate

Leave a Comment

I get this error on my default WordPress feed: pubDate must be an RFC-822 date-time: Mon, 30 Nov -0001 00:00:00 +0000

Anything inherently evil in pubDate? And if so how to solve the problem?

3 Answers

Answers 1

If you look at the two occurrences of the error from Feed Validator, it's only happening because of the oldest two posts in the feed. Every post after that has the correct pubdate specification. WordPress itself follows the specification, but those two posts are missing the year.

This answer might be of use, as it's what's occurring in your posts

There are 4 dates stored for each WP post: Post_date, post_date_gmt, post_modified and post_modified_gmt. I recommend you to insert the same date for both post_date and post_modified and see if it works.

That worked, thanks! It was just the post_date_gmt field that needed to be set.

If it's just those two, you can manually edit them in the wp_posts table in your database if you feel comfortable doing so, or there are various plugins available that can help with doing such a thing.

PSA: Always have a backup of your database before fiddling with it.

Answers 2

Upgrage your plugins with newer version here https://wordpress.org/plugins/wordpress-seo/ because there is a bug https://github.com/Yoast/wordpress-seo/issues/525

but if it has not been solve your problems, then better you remove this two post your.url/cliff-diving-boracay-philippines your.url/bora-bora-activities-snorkeling-hibiscus

or make new version of those.

Answers 3

Try this .. might work

Go into your wp-includes directory and edit the feed-rss2.php file.

Replace this (line no : 89):

<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate> 

With this:

<pubDate><?php echo mysql2date('r', get_the_time('Y-m-d H:i:s')); ?></pubDate> 

And also try to update the Post for which the date is wrong : post ID = 17624 and 17637 or see the published date of these posts in edit screen

enter image description here

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment