I am stuck! Any help would be much appreciated.

I use Google (XML) Sitemaps Generator for WordPress
(http://www.arnebrachhold.de/projects/wordpress-plugins/google-xml-sitemaps-generator/)

And it generates a sitemap:

But the links don't pick up the categories that are used in the address. For example, my page is:

But the sitemap generator misses the naughty office category:

And Google Webmaster tools pick this up as a 404 error. Webmaster tools displays:

Any ideas how can i get Sitemap Generators to pick up the links?

Dani AI

Generated

— the sitemap symptom you describe (sitemap URLs missing the category segment and throwing 404s while the browser URL with the category works) is almost always a permalink/rewrite or URL-construction problem in the sitemap generator itself. ’s hand-built sitemap is a useful temporary fix and is right to point at trying a different plugin, but a quick checklist will help find the underlying cause so auto-generation can be fixed.

First, confirm WordPress rewrite rules are healthy: visit a category-style permalink for a post and confirm it loads, then go to Settings > Permalinks and click Save Changes to force WordPress to flush rewrites. Ensure the site’s .htaccess contains the standard WordPress rules and is writable by WP when saving permalinks; a minimal .htaccess looks like this:

# WordPress basic rewrite
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

Second, inspect the sitemap plugin code (search for places it builds URLs). If the plugin concatenates home_url() + $post->post_name or uses $post->guid it will drop the category part. Replace manual assembly with the WordPress permalink API so WordPress itself returns the correct pretty URL:

$loc = get_permalink( $post->ID );

Third, check lifecycle and test behavior: confirm the sitemap is generated at a point where WP rewrite rules and permalink structure are available (after init, or during a standard admin request). If the plugin runs too early or outside WP context (custom cron run, activation hook), get_permalink() may not return the expected pretty URL.

Finally, safe practices: back up files before editing plugins, test fixes on a staging copy, and if editing is not comfortable, look for a maintained sitemap plugin that uses get_permalink() or contact the plugin author with a short bug report describing the missing category segment. These steps close the loop between ’s temporary sitemap and ’s suggestion to change plugins, and they point to where the real fix usually lives — either rewrite rules or the plugin’s URL construction.

Recommended Answers

All 4 Replies

I saw errors in your sitemap. However, I generated another sitemap for you. I believe it is complete now. Just copy the code below:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
- <url>
  <loc></loc> 
  <priority>1.00</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.80</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.64</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.64</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.64</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.64</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.64</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.64</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.64</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.64</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.64</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.64</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.64</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.64</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.64</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.64</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.64</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.64</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.64</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.64</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.64</priority> 
  <changefreq>always</changefreq> 
  </url>
- <url>
  <loc></loc> 
  <priority>0.64</priority> 
  <changefreq>always</changefreq> 
  </url>
  </urlset>

Please, don't forget to mark this thread as solved if this sitemap serves your needs. If not, reply and I will be willing to help you the best I can.

Sitemaps are generated with generators based on the links they follow to find a page. If you want to include the category, and especially if the generator is picking up no category; then you should check how your wordpress is configured for displaying links.

If your wordpress plugin is generating errors, try a new generator. Or, you can just use a few of the online ones.

Here is the link to the new wordpress plugin from May. The author's website for the plugin you are using hasn't been updated since last year. http://wordpress.org/extend/plugins/google-sitemap-generator/

Thank you for the replies and the site map.

But as this is a blog I will need to regularly update the sitemap so I am hoping to get a plugin to work and auto generate.

My permalinks use a custom structure that was recommended as good for SEO '/%category%/%postname%/' and I am already using of the Google Sitemaps Generator.

I will look for some other wordpress plugins that might replace this software and update the thread if i am successful.

Yes, I knew your site is a Blog and I just provided a short-term solution. Well, I don't know of any WordPress plugin, as I haven't used it before. If you cannot find a suitable plugin, try to hire someone to develop a customized sitemap generator for you. And I believe it won't be costly.

While you're still looking for a long-term solution, you can be using this Online sitemap generator to update your site: http://www.xml-sitemaps.com/

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.