Forums

[Plugin: Google XML Sitemaps] incompatible with plugin page-links-to (2 posts)

  1. worufu
    Member
    Posted 3 years ago #

    Hello,

    "page-links-to" is a plugin which lets you redirect wordpress pages to other URLs. I am using it to have one and the same page appear in multiple menus.

    The google xml sitemap query for pages with activated "page-links-to" plugin not always returns full URLs. It returns whatever you put as URL value within page-links-to. In my case it's relative URLs (which ave to be relative to work together with qtranslate to produce valid multilanguage URLs).

    My temporary fix was the followin snipped of code in line #1601 of sitemap-core.php (function addEvent()):

    if(is_object($page) && 'GoogleSitemapGeneratorPage' == get_class($page))
            {
                if(!preg_match('/^https?:\/\//i', $page->GetUrl()))
                    return;
            }

    As page-links-to just generates kind of "aliases" for existing internal pages those links can be removed from the sitemap.xml (which my snipped does). External links will start with http anyways... so they are not excluded... probably should by definition of sitemap.xml... don't know the details of the standard. Anyways... no domain name checking yet.

    Hope this fix (or a better solution) will be incorporated into a future plugin release.

  2. dreamwhisper
    Member
    Posted 2 years ago #

    Another issue is that if you link a page to a post, XML sitemaps lists the url 2 times in the sitemap.

Topic Closed

This topic has been closed to new replies.

About this Topic