Missing CPT in sitemap
-
Hello,
I have just added a huge subsection (well 120 posts of a given CPT), but neither the archive, nor the individual posts appear in the sitemap.
The archive page :
https://parapente-mexico.com/ecole-parapente/I obviously searched the support thread before regarding this problem, but none of them prove to be helpful.
I remove the sitemap, clear the cache, enabled it again, to no avail.
My CPT is made public :
"public" => true, "publicly_queryable" => true,
Any idea ?
The page I need help with: [log in to see the link]
-
We’re sorry for the trouble caused, this must’ve been very annoying for you. We see the relevant CPT is set public.
Have you checked the SEO settings via SEO > Search Appearance > Content Types(tab)
and within it set the relevant CPT is toggled to appear in the search results?If the setting is in order but the issue still persists, we recommend doing a conflict check.
Often, we see problems occur in combination with another plugin or theme. The fastest way to rule out any conflict, is to deactivate all non-Yoast plugins and switch to a standard theme like Twenty Twenty.
Please test this on your development or staging site, if you have one. If not, we recommend using the Health Check & Troubleshooting plugin. This plugin has a troubleshooting mode, which does not affect normal visitors to your site.
If you’re unfamiliar with checking for conflicts, we’d like to point you to a step-by-step guide that will walk you through the process: How to check for plugin conflicts
If you do not feel comfortable to do this yourself or if this does not solve your issue, our Yoast SEO Premium plugin comes with one year of (technical) support.`
Have you checked the SEO settings via SEO > Search Appearance > Content Types(tab)
and within it set the relevant CPT is toggled to appear in the search results?Yes, I did.
So I installed the plugin you recommended, but the problem still occurs (even with default theme and Yoast SEO being the only plugin activated in troubleshooting mode).
Hi @elcondorito
If we’re understanding it correctly, you have a CPT called ‘Ecole Parapente’ and you’re wondering why it isn’t being listed in the sitemap, correct?
Since you’ve mentioned that the CPT is public, it should theoretically be included in the sitemap. It would be excluded from the sitemap only under the following circumstances – https://developer.yoast.com/features/xml-sitemaps/functional-specification/#exclusions–empty-sitemaps
We’re checking this sample CPT post (https://parapente-mexico.com/ecole-parapente/absolute-chamonix/) and we see it doesn’t have a meta robots tag in the page source. Are you able to edit this CPT in the backend of your WP admin dashboard?
Hello Michael,
Thank you, for your reply. I am actually a little desperate about this.
I created the whole thing to improve my SEO, and in fact, it does not get indexed so well, for lack of sitemap entries…At some point I put these CPT posts as “no-index” (non searchable), in Yoast settings (as far as I remember), while it was not officially public, and I was working on it (populating them). Then switched them back to “searchable/indexable”. Is there any other way to set a CPT as non-indexable ?
I haven’t edit my robots.txt file either. At least intentionally.I created a template for this CPT post (e.g single-ecole-parapente.php), and even the archive page. I can provide the code if needed. For the record, these templates are located in a custom plugin directory (instead of the child theme).
I don’t think I could be the reason for the bug I have. Just mentioning for completeness.I don’t really understand the point about meta robots tag. Should I add something manually in my template ?
I do see some meta robots tags :
<meta name="robots" content="max-snippet:-1, max-image-preview:large, max-video-preview:-1" />
Just as in the regular post, BTW, which are indexed.
Am I missing out something ?I used CPT-UI plugin to create these, but then copy-pasted the generated code into my custom plugin, and uninstalled CPT-UI altogether (to avoid plugin clutter).
Do you think the initial code could be still in database and conflicting ?Once again I could provide my custom plugin code for inspection.
Yes, I am able to edit the data of each of these CPT posts in my back-end, if I understood your question correctly. Just like a normal posts, but with extra fields (ACF).
I also provided a way for users to create their own content on the front-end (without registering). You can see the creation page at “/creer/”.
They can even edit it, via a unique url + encrypted param, afterwards.
Once again, I mention this for the sake of completeness. I don’t think it’s related.Any help, hint … would be MUCH appreciated.
While there are several ways to set
noindex
custom post types using Yoast SEO plugin (i.e. using a filter, robots.txt, settings, etc.), it’s odd that you haven’t done any of those and the relevant custom post type items aren’t appearing in the XML sitemap.To verify whether your custom code is causing the issue or something else, are you able to create a custom post type using the ACF plugin to see whether the relevant items appear in the XML sitemap? If yes, we know that it’s definitely something specific to your code.
Hello @mazedulislamkhan ,
I did what you suggested, and indeed it works.
So now the problem still occurs with my own CPT ‘ecole-parapente’.
Maybe something to do with the hyphen… I don’t know.Still Yoast is not at stake.
Thank you again. It’s not solved yet, but we’re moving on.
edit : I did a very simple CPT (via CPT-UI plugin). Not using ACF though /edit
- This reply was modified 2 years, 10 months ago by elcondorito.
Hi,
We understand it works just fine (and that it’s showing up in the sitemap) with another CPT created using the CPT-UI plugin. We’re not exactly sure why it isn’t being generated for the other ‘ecole-parapente’ CPT. It may have to do with the custom code or how the CPT was created specifically.
We might need to investigate further but we’re unable to do so over these public forums. You may want to consider Yoast SEO Premium so we can take a closer look at this.
For those it may concern, I found out a solution.
I created my own sitemap.xml file based on this solution :
https://wordpress.stackexchange.com/questions/15218/how-to-generate-update-a-xml-sitemap-without-plugins, only for my custom post type (so the code here as been tweaked slightly for my own purposes).Then you need to log in to the Google Search Console (https://search.google.com/search-console/).
Add your new custom-sitemap.xml url under Index > Sitemaps.
That’s all folks !
- The topic ‘Missing CPT in sitemap’ is closed to new replies.