Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
We have a site which has multiple 301 redirects in place for pages which once existed on their own but are now redirected elsewhere using the redirect module.
These original pages no longer exist in the CMS or are unpublished.
The generated XML sitemap retains these now redirected links in the sitemap.xml file generated. An external SEO agency has instructed the client that this is bad practice and the XML sitemap entries which are 301 redirects need to be removed.
Does anyone have any ideas on how I could omit these?
Thanks,
Gary
Comment | File | Size | Author |
---|---|---|---|
#10 | xmlsitemap-remove_301_redirected_pages-2968055-10.patch | 2.04 KB | artem_sylchuk |
| |||
#10 | interdiff_8_10.txt | 865 bytes | artem_sylchuk |
Comments
Comment #2
garyh CreditAttribution: garyh commentedComment #3
garyh CreditAttribution: garyh commentedComment #4
thebumik CreditAttribution: thebumik at OPTASY for OPTASY commentedI've provided an integration with Redirect. So you can easily skip the nodes/pages which are 301 redirected.
Comment #5
thebumik CreditAttribution: thebumik at OPTASY for OPTASY commentedComment #6
cyberlily CreditAttribution: cyberlily commentedWhat's needed to get this patch released? Happy to help since we need it too.
Comment #7
Chris Matthews CreditAttribution: Chris Matthews commentedThe patch in #4 to xmlsitemap.admin.inc and xmlsitemap.generate.inc does does not apply to the latest xmlsitemap 7.x-2.x-dev and if still applicable needs a reroll.
Comment #8
Den Tweed CreditAttribution: Den Tweed at Coworks.be commentedRerolled
Comment #9
renatogComment #10
artem_sylchukThanks for the patch.
I've tried it and it works, but redirect_fetch_rids_by_path has the third argument which controls if the disabled redirects are returned or not.
By default it returns disabled redirects too.
Updated patch to exclude the disabled ones. This also has the performance impact as the status column is the part of the index.
Comment #11
aamortimer CreditAttribution: aamortimer commentedTested patch #10 and all is working for me, thanks for the patch really useful.
Comment #12
rpayanmComment #13
darrell_ulm CreditAttribution: darrell_ulm as a volunteer commentedAlso tested patch #10 and appears to work.
Comment #14
darrell_ulm CreditAttribution: darrell_ulm as a volunteer commentedComment #15
alex_optimGood for me too.
Comment #16
pifagorComment #18
pifagor