Forums

[Plugin: Google XML Sitemaps] Sitempa still adding trailing slash? (8 posts)

  1. LincolnAdams
    Member
    Posted 1 year ago #

    I made a major upgrade leap from 2.0.X to 2.6 and everything is working, except I noticed my permalinks no longer have trailing slashes, and any attempt to use them results in a 301 redirect to the same permalink, but without the slash.

    This wouldn't be a problem, except that when my sitemap is generated, it is generated using the trailing slashes. so i am getting an error in Google Webmaster because all of my sitemap links are really 301 redirected links now. Has anyone else seen this? How could I fix it so Sitemap publishes the actual destination URL again (without the slash)?

  2. LincolnAdams
    Member
    Posted 1 year ago #

    Found a temporary fix:

    On line 1963 of sitemap-core.php you should see this:
    $subPage = trailingslashit($permalink) . user_trailingslashit($p, 'single_paged');

    Replace that with this:
    $subPage = untrailingslashit($permalink) . user_trailingslashit($p, 'single_paged');

    The untrailingslashit function should remove the trailing slashes and provide the correction destination URLS in your sitemap for Google.

    This is a rather important issue and I'm surprised no one noticed it till now. It would appear to affect anyone using WP 2.3 and above ever since they so thoughtfully changed the permalink structure so that trailing slashes were removed.

  3. ravetildon
    Member
    Posted 1 year ago #

  4. ravetildon
    Member
    Posted 1 year ago #

    My current permalink structure is:

    /%category%/%postname%/

    if I change it to /%category%/%postname%

    it works fine. But I want the trailing slashes. A site will oad faster with trailing slashes.

  5. ravetildon
    Member
    Posted 1 year ago #

    Another weird thing happens....

    If I hit rebuild site map manually, all the links are correct.

  6. prof611
    Member
    Posted 1 year ago #

    My problem is very similar to the one discussed above. I use a customized permalink structure: /%category%/%postname% . This plugin removes the category and leaves only //%postname% !

    My first sitemap was hand-coded, and when I switched to this plugin, I thought nothing of it until I noticed that Google Webmaster Tools was listing a lot of my posts as NOT FOUND.

    By that time, my "sticky" post, which had been at #3 for my primary keyword, was WAY down somewhere below #100.

    My only solution so far is to go back to hand-coding my sitemap. I hope that Google will soon put me back on page 1. Visitors have dropped from an average of 20/day, with peaks up to 175, down to around 5/day.

    At this point, I would STRONGLY urge everyone to avoid this plugin if they want to stay in Google's good graces.

  7. Vissekop
    Member
    Posted 1 year ago #

    Dear all,

    I have the same issue, but with one remark:

    In my sitemap, there are indeed trailing-slashes, e.g.:
    http://www.huizje.nl/blog/vakantie-in-italie/
    (view: http://www.huizje.nl/blog/sitemap.xml)

    However, if I look in the google webmaster-tools for the crawl results, he indeed states that he cannot find it, but I found that Google adds an extra index.html behind the trailing slash:

    http://www.huizje.nl/blog/vakantie-in-italie/index.html. And of course, Google is not able to find this page.

    Indeed strange that this issue isn't tackled before...

    Gr. Vissekop.

  8. okorioth
    Member
    Posted 1 year ago #

    Just to throw this out there, I too just started using this plugin and have customized link structure. The solution was to disable automatically update the file for each post. Now I occasionally run a manual build and its working.

Topic Closed

This topic has been closed to new replies.

About this Topic