Closed arthurshlain closed 2 years ago
I am afraid I couldn't reproduce the issue using the steps you provided. I created a new custom taxonomy for Pages
using the example code snippet you provided. I published new pages and made sure the new pages had the relevant custom taxonomy. I selected the relevant custom taxonomy for page post type from the Yoast SEO breadcrumbs setting to ensure the relevant custom taxonomy appears in the breadcrumb path.
When visiting the single page, I see the breadcrumb path as expected [Home](https://rgetic-eel-dohe.instawp.xyz/) » [Chrome](https://rgetic-eel-dohe.instawp.xyz/page_type/chrome/) » One
. Chrome is the new custom taxonomy generated using the code snippet you provided.
Did I miss anything?
Why your middle link is /page_type/
? It's the my problem. But you need to check it on single post, not page. I have ~20 posts (not pages) where /page_type/
exists in breadcrumbs.
It's hard to reproduce, because new posts have correct breadcrumbs.
I would recommend just taking a look at the code for a possible erroneous taxonomy assignment in the _yoast_wpseo_primary_category
meta value, or wait until someone maybe have same issue.
My new posts have this structure:
[Home](https://domain.xyz/) » [Techhub](https://domain.xyz/techhub/) » Post Title
Old/not modified posts has this structure:
[Home](https://domain.xyz/) » [Product Page](https://domain.xyz/page_type/product/) » Post Title
My permalink structure is /%category%/%postname%/
, prefixes is empty, but I maybe miss say I use this plugin (installed before SEO plugin) to remove cateogry base https://wordpress.org/plugins/remove-category-url/
Can I remove _yoast_wpseo_primary_category
meta values from databse to fix my breadcrumbs?
/page_type/
?
/page_type
is the slug of your custom taxonomy you created for the Pages. In the example I shared, the middle part is the custom taxonomy for Pages.In register_taxonomy('page_type', ['page'])
the second parameter means the taxonomy should be associated with Pages only. It's impossible to check it, because no related metabox shown for it.
Resetting indexables not solves this issue, the _yoast_wpseo_primary_category
values still exists in meta table.
Since I have a hard time reproducing the issue, it is time to move the issue to our support team. If you own a premium subscription, you can reach us at support@yoast.com email address. If not, the public forum will also do the job.
Please give us a description of what happened.
I found the issue when breadcrumbs category at
single-post.php
template is wrong. The category name in breadcrumbs refers to custom taxonomy, registered forpage
post type only:register_taxonomy('page_type', ['page'], [...]);
In DB
post_meta
table I found meta key_yoast_wpseo_primary_category
with value that refers topage_type
custom taxonomy record, not category. I did not make any changes to the database, it is probably so indexed by seo plugin.How it's looking at page:
Front page » Product Page » The post title
where Product Page — is
page_type
taxonomy.How expected:
Front page » News » The post title
where News — is
category
taxonomy.Please describe what you expected to happen and why.
I expected to see correct category in breadcrumbs for
single-post.php
How can we reproduce this behavior?
This is approximate list:
page
post type (example below).[wpseo_breadcrumb]
For example, my site has 2 post categories and 2 custom taxonomy records.
Example code for reproduce step 1
Technical info
Used versions