Google Sitemap plugin fix (3 posts)

  1. baptiste
    Posted 9 years ago #

    I use Arne's Sitemap Plugin (http://www.arnebrachhold.de/redir/sitemap-home/) on many of my sites, most of which are mainly posts, not pages. However for a recent project, the site was mostly pages, multiple levels deep.

    After getting errors from Google about my sitemap, I found that all the entries for pages had only the pagename in them - none of the parent path info was being included.

    After a bunch of debugging, I found that the post_parent attribute was left out of the SQL query in the sitemap plugin. To fix this, I simply added ", post_parent" to line 1566 of the plugin. Now that the data is retrieved, the WordPress permalink functions work as expected.

    So Line 1566 changed from:
    $sql="SELECT ID ,post_modified, post_date, post_status, post_author, post_name "

    $sql="SELECT ID ,post_modified, post_date, post_status, post_author, post_name, post_parent "

    [bbPress took out the single quotes from the post - be sure to INCLUDE them so the post_parent part looks like the other fields in the query]

    I let Arne know of this simple fix, but figured I'd post it here in case others are wondering why their subpages are failing in their sitemap.xml file when using this plugin.

  2. msmeritt
    Posted 9 years ago #

    Fantastic! I noticed this error immediately after I installed the plugin. Your fix worked beautifully!

  3. Arne Brachhold
    Posted 9 years ago #

    Thanks to baptiste for this posting! This bug is resolved in the latest beta (3.0b5). You can get it here.

Topic Closed

This topic has been closed to new replies.

About this Topic