Yoast / wordpress-seo

Yoast SEO for WordPress
https://yoast.com/wordpress/plugins/seo/
Other
1.77k stars 894 forks source link

Use the CPT/taxonomy slug instead of the rewrite slug in the URLs for settings sections #20864

Open enricobattocchi opened 11 months ago

enricobattocchi commented 11 months ago

What is the goal of this issue?

We currently use the rewrite slugs instead of the post type or taxonomy slugs to build the direct URLs to the relevant sections in the settings, e.g. /wp-admin/admin.php?page=wpseo_page_settings#/post-type/rewriteslug instead of /wp-admin/admin.php?page=wpseo_page_settings#/post-type/posttypeslug. This can be a problem in some cases since the rewrite slug can change, so the URLs would change too; also, only the main slug is unique, so if a site admin registers a post type or a taxonomy that overrides the rewrite slug of a builtin type, the section for that content type is unreachable. This is already experienced by some users for taxonomies: https://github.com/Yoast/wordpress-seo/issues/20016

What needs to be done to achieve the goal?

We need to update how the URLs are created to use the main slug and not the rewrite slug.

Does the issue still need UX or research?

Not really, we don't expect side effects (though we need to make sure to check this). Being totally on the backend side, there should not be any effect on the front-end/SEO side

If available: what are the tips for fixing the problem or possible solutions?

See above

Should documentation be added or updated for this change? and if so, where?

No.

amboutwe commented 6 months ago

Please inform the customer of conversation # 1130682 when this conversation has been closed.

josevarghese commented 6 months ago

In https://github.com/Yoast/wordpress-seo/issues/20341 we noticed the same issue occurs for the Tutor LMS CPT

Step-by-step reproduction instructions

  1. Install Yoast SEO
  2. Install Tutor LMS
  3. Navigate to WordPress > Yoast SEO > Settings > Content Types and select Assignments.
  4. You'd notice that Lessons and Quizzes are also selected/activated in the menu.

Expected results When I click Assignments, I expect to be taken to the Assignments post type settings page When I click Lessons, I expect to be taken to the Lessons post type settings page When I click Quizzes, I expect to be taken to the Quizzes post type settings page

239921116-b044081e-48b7-4c59-b97a-9f4943704cc1

josevarghese commented 6 months ago

+1 https://wordpress.org/support/topic/yoast-seo-and-tutor-lms-lessons-settings-drives-to-questionnaires/

josevarghese commented 6 months ago

Comment from Ramon here.

The URL loaded by Yoast SEO for the three post types Assignments, Lessons and Quizzes is the same: /wp-admin/admin.php?page=wpseo_page_settings#/post-type/lesson

image

A similar issue happens with the Directorist plugin https://github.com/Yoast/wordpress-seo/issues/20016

josevarghese commented 6 months ago

Please inform the customer of conversation # 1072770 when this conversation has been closed.

josevarghese commented 6 months ago

Issue merged from https://github.com/Yoast/wordpress-seo/issues/20016

Issue: Custom taxonomy tags added by Directorist plugin failed to open its respective SEO settings.

Step-by-step reproduction instructions

  1. Install and Activate Directorist plugin - Business Directory Plugin.
  2. Go to Yoast SEO > Settings >> Categories and Tags
  3. Click the Directorist Categories menu. You will see SEO settings for it.
  4. Click the Directorist Tags menu. You will be taken to the Category setting instead of the Tags settings.
  5. Both Tags and Categories has same URL as given below:

https://example.com/wp-admin/admin.php?page=wpseo_page_settings#/taxonomy/at_biz_dir-tags

Expected results The Tags and Categories taxonomy should have a unique URL under the SEO settings page like WordPress default tags and category.

Custom post type category slug: at_biz_dir-category https://example.com/wp-admin/edit-tags.php?taxonomy=at_biz_dir-category&post_type=at_biz_dir

Custom post type tag slug: at_biz_dir-tags https://example.com/wp-admin/edit-tags.php?taxonomy=at_biz_dir-tags&post_type=at_biz_dir

225576604-cb3fa0a4-eb34-411f-8d1f-70274d780e0e

josevarghese commented 6 months ago

Please inform the customer of conversation # 996719 when this conversation has been closed.

josevarghese commented 6 months ago

Please inform the customer of conversation # 1072770 when this conversation has been closed.

amboutwe commented 6 months ago

Conversation # 1130682: Issue occurs with Paid Memberships Pro

ogodoabiola commented 5 months ago

Please inform the customer of conversation # 1134067 when this conversation has been closed.

josevarghese commented 5 months ago

Please inform the customer of conversation # 1136002 when this conversation has been closed.

maybellyne commented 1 month ago

Please inform the customer of conversation # 1177637 when this conversation has been closed.