Make WordPress Core

Opened 11 months ago

Last modified 7 weeks ago

#59998 new enhancement

Hide terms from XML sitemap that have only one object in them

Reported by: joostdevalk's profile joostdevalk Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Sitemaps Keywords:
Focuses: Cc:

Description

People create a lot of taxonomy terms, most specifically, tags. On many, many sites, a lot of those tags only have one post in them. This results in a term archive with 1 single post. This isn't useful to anyone, and it surely isn't useful to add to our XML sitemaps.

So, I would propose that instead of what we currently do, which is hiding all the empty terms, we hide all the terms that have less than 2 posts in them (so, 0 or just 1).

Change History (1)

#1 @chaos1
7 weeks ago

I've been working with a WordPress theme and used the demo content to speed run on how to build out templates, posts, pages, and custom post types on Elementor.

While I was setting up a Google Ads campaign, it suggested landing pages that I had no idea was visible. It turns out Google Ads grabbed the sitemaps.xml page and made suggestions based off of that.

I discovered all the demo content was exposed to the internet, set it all to drafts, but still see custom post types that shouldn't be in my sitemaps.xml, along with administrative level user that shouldn't be displayed.

At the moment, I'm having a hard time finding documentation on WP_Sitemaps because I want to exclude all the unnecessary categories. To top it all off, I have a special landing page for a Googles Ad campaign that I only want Ads traffic to go too. This page includes special pricing for the target audience. The WP Sitemaps exposes this landing page to anyone curious enough to look at sitemaps.xml

Last edited 7 weeks ago by chaos1 (previous) (diff)
Note: See TracTickets for help on using tickets.