Issue with WordPress SEO Sitemap
-
I have installed the plugin WordPress for SEO for my blog and I noticed that the xml sitemaps were not properly being generated. Those that required to run an SQL query were returning a 404 Not Found page.
After searching the code for this module I found out that there was an improper query being propagated from the WordPress SEO plugin to PG4WP 1.3.1 which did the following :
SELECT COUNT(ID) FROM $wpdb->posts {$join_filter} WHERE post_status IN ('publish','inherit') AND post_password = '' AND post_author != 0 AND post_date != '0000-00-00 00:00:00' AND post_type = %s
The problem was that in SELECTS there wasn’t a proper sanitization for 0 ansi datetime.
I fixed it by adding at line 287-288 of driver_pgsql.php file :
after
if( false !== strpos( $sql, $wpdb->comments)) $sql = str_replace(' comment_id ', ' comment_ID ', $sql);
I added :
$sql = str_replace("'0000-00-00 00:00:00'", "'1970-01-01'", $sql);
See a detailed description of the error at my blog site here :
https://www.must-feed.com/2014/08/31/wordpress-seo-sitemap-heroku/
- The topic ‘Issue with WordPress SEO Sitemap’ is closed to new replies.