• My WordPress install is in a subfolder (e.g., https://www.domain.com/blog), and I want to include links to non-WordPress pages *above* the subfolder in the external pages sitemap (e.g., the home page https://www.domain.com).

    However, the array in the my_external_sitemap function requires the format home_url(‘page-name’) which doesn’t allow this. home_url prefixes the WordPress blog URL before the page name.

    If I remove the home_url function, like this:

    array(‘location’ => ‘https://www.domain.com’, ‘lastmod’ => ’06/02/2011′, ‘priority’ => ‘1.0’),

    Then the link is not generated in the site map at all.

    Is there anyway to generate external page links without requiring home_url to be used?

    https://www.ads-software.com/plugins/bwp-google-xml-sitemaps/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Khang Minh

    (@oddoneout)

    You can’t have pages above the subfolder included in the sitemap (as per the sitemap protocol).

    You will have to add some kinds of rewrite rules to make your sitemap accessible at https://domain.com/sitemap.xml, which will be redirected to https://domain.com/blog/sitemap.xml. But even with that there’s a check in the plugin that invalidates all links that not under the same directory.

    I will take note of this and see if it can be improved in next release.

    Thread Starter bahead

    (@bahead)

    Thanks for the response, that makes sense. I checked the protocol and you can’t include links to other folders in the same hierarchy either. So, unless one wants to create and maintain sitemaps for every folder, one needs have the sitemap in the root folder only, so it can include all subfolders. There are some websites where WP is installed in a subfolder, so I hope you can address this in the next release (because your plugin is excellent otherwise). For the time being, I’ll have to deactivate the plugin as to not negatively affect the current Google search/news indexing for my site.

    Thread Starter bahead

    (@bahead)

    Khang, I see you’ve now released version 1.3.0. Did you look at this issue at all? I understand if you didn’t, as it’s not a major problem and from the release notes you’ve had more significant improvements to make. But I just thought I’d check.

    Plugin Author Khang Minh

    (@oddoneout)

    Have you tried using a rewrite rule for this? Something like below in your .htaccess file:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^sitemap\.xml$ /blog/index.php?gxs_module=sitemapindex [L]
    </IfModule>
    

    Make sure you have pretty permalinks enabled as well.

    Thread Starter bahead

    (@bahead)

    I’ll give it a try, thanks for the suggestion.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘External Pages Sitemap – How to include links in higher folder?’ is closed to new replies.