Add an option to ignore the homepage twin link in the sitemap.xml

Created on 22 March 2019, over 5 years ago
Updated 5 September 2024, 3 months ago

Problem/Motivation

I defined as homepage a node in `/admin/config/system/site-information` but there are two links of my home page in the generated sitemap.xml :
my-site.com/node/1 and my-site.com/
Same issue like : https://www.drupal.org/project/simple_sitemap/issues/2894762

Proposed resolution

Instead of the issue solution ( #2894762 ), add a checkbox in the configuration form when she's active, the generation ignores automatically the link defined in the site configuration : /admin/config/system/site-information

This solution doesn't force the user to duplicate the link of the hompage that can be modified in one place and not the other.

Original report

https://www.drupal.org/project/simple_sitemap/issues/2894762

You think it can be a possible solution?

Feature request
Status

Closed: works as designed

Version

3.0

Component

Code

Created by

🇫🇷France rmpereira

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States jimmb

    I'm also having this problem, having built a Drupal1 10 site with Layout Builder and consequently having a node for the homepage (/homepage) that's also loading at the main domain URL.

    As such, in the XML sitemap, I'm seeing the same page twice: domain.com and domain.com/homepage

    My question is about this from comment #2 above:

    you should ... go to admin/config/search/simplesitemap/custom and exlude the path /.

    This would be a perfectly fine solution in the UI, but I'm not seeing how to do that. At /admin/config/search/simplesitemap/custom, I'm just seeing 'Add custom internal drupal paths to specific sitemaps.' and the 'Default' field below that (neither of which seem to apply here). And under that is 'Include images', which also isn't applicable.

    So, where is this field where I can plug in "/homepage" as a relative path and have it excluded from the XML sitemap generation?

  • Status changed to Active 6 months ago
  • 🇺🇸United States jimmb
  • 🇩🇪Germany gbyte Berlin

    @jimmb If /homepage is a node, why not exclude that single node from index? (Edit the node and exclude it under the sitemap settings.)

    And to answer your question (but in your case the above solution would be better I think): The default homepage is being indexed in the custom link area - removing the '/' from there means excluding the home page (or its duplicate) from index.

  • 🇺🇸United States jimmb

    Thanks so much for the reply! I'd considered doing what you suggested, but thought it would also remove the homepage on the main domain from being indexed....

    But I just went into 'Edit' mode for /homepage, and selected "Do not index this Landing Page entity in sitemap". I then went to /admin/config/search/simplesitemap and clicked "Rebuild queue & generate".

    And afterward, viewing my domain.com/sitemap.xml, I am seeing the main domain (i.e. the de facto homepage) as being indexed but not the redundant /homepage page. So this looks perfect now!

    Thanks again for the help, and I will close this issue.

  • Status changed to Closed: works as designed 6 months ago
  • 🇺🇸United States jimmb
  • 🇩🇪Germany gbyte Berlin

    For 4.x see Respect front page configuration Closed: won't fix

Production build 0.71.5 2024