Coder Social home page Coder Social logo

Comments (23)

josevarghese avatar josevarghese commented on June 8, 2024

Hi @brightcherry

Thanks for using the Yoast SEO plugin and for creating the issue.

The permalinks you shared with us are not clear for us to reproduce this issue. So, can you share a full-page screenshot of the Permalink settings and how you have created the pages which is showing a 404 error with more detailed steps? It will help us to understand the issue better by reproducing it.

We look forward to hearing from you and are happy to help you.

from wordpress-seo.

brightcherry avatar brightcherry commented on June 8, 2024

Hi @josevarghese

Many thanks, appreciate it.

Here is the screenshot:

yoast

Couple of other settings:

  • I have created a page called "Blog" which has a permalink "blog", and this is set as the "Posts page" (Settings > Reading > Posts page)
  • I have created a post category called "Blog", which also has the permalink "blog" (I know this may seem counter-intuitive, but it's the only way it was possible to achieve the permalink structure I explained)

That should explain why the issue occurs when preventing the blog page from being accessible, and which is why I recommend it should be an option, not a "bug fix"

After updating Yoast to Yoast 22.0, this permalink structure no longer worked, and all category pages returned 404 errors. For example:

https://www.domain.co.uk/blog/category-1/
https://www.domain.co.uk/blog/category-2/

Hope that helps.

Please let me know if you need any further details.

from wordpress-seo.

maybellyne avatar maybellyne commented on June 8, 2024

+1 https://wordpress.org/support/topic/yoast-22-0-blog-category-404-issue/

from wordpress-seo.

maybellyne avatar maybellyne commented on June 8, 2024

+1 https://wordpress.org/support/topic/upgrade-from-21-9-1-to-22-0-0-breaks-category-pages/

from wordpress-seo.

aramshaw avatar aramshaw commented on June 8, 2024

In case it assists, here is our permalink page: (https://wordpress.org/support/topic/upgrade-from-21-9-1-to-22-0-0-breaks-category-pages/)

image

from wordpress-seo.

josevarghese avatar josevarghese commented on June 8, 2024

Hi @aramshaw and @brightcherry

Thanks for sharing the details. When I tried to reproduce the issue without having the Yoast SEO plugin, I noticed the 404 error for the category URLs. I set the permalink custom structure as "/blog/%postname%/" and "/blog/%postname%/%post_id%" and then I set the category base as "." within the Permalinks settings page. Then I navigated to the category pages and noticed that the URL of the category view page was changed from domain.com/category/blog/ to https://domain.com/blog/ and noticed that the page is responding with a 404 error. You can check this site.

So, can you please confirm whether you have tested this specific case without having the Yoast SEO plugin as active on your websites?

Looking forward to hearing from you.

from wordpress-seo.

brightcherry avatar brightcherry commented on June 8, 2024

Hi @josevarghese

Apologies, but I'm slightly confused, I'm not sure I fully understand your question.

The permalink structure I described in my initial post wouldn't work without the Yoast plugin because of the required "Strip category base" feature. That needs to be enabled.

Without the Yoast plugin, domain.com/category/blog/ works fine (as expected), but domain.com/blog/ does not ("blog" is a category slug).

Many thanks

from wordpress-seo.

josevarghese avatar josevarghese commented on June 8, 2024

Hi @brightcherry

But it's not loading at my end even without having the Yoast SEO plugin as active. See the screencast for your reference: https://www.loom.com/share/089d1ad71e75493e8f1d39cd6fcfed03

The issue is caused by adding the Category as "." which removes the category from the URL and causes a 404 error. When I create a blog page, the the category having the slug blog is only getting loaded (as the blog page is loading for the slug /blog/), and all other categories on the website still show the 404 error.

Looking forward.

from wordpress-seo.

brightcherry avatar brightcherry commented on June 8, 2024

Hi @josevarghese

Perhaps this better highlights the problem: https://www.loom.com/share/b6022347cd4c4efb91ab563724746b67

Please let me know?

Many thanks

from wordpress-seo.

brightcherry avatar brightcherry commented on June 8, 2024

Hi @josevarghese

Sorry, just to clarify, the two key issues that appear after updating to the latest Yoast version:

  1. The page with the "blog" slug gets precedent over the post category with the same "blog" slug, where as I think it was the other way round previously (this is what I believe should be optional).
  2. The sub-categories of the parent category with the "blog" slug return 404s (because of point 1)

Hope that helps.

Thanks again.

from wordpress-seo.

josevarghese avatar josevarghese commented on June 8, 2024

Hi @brightcherry

I can see it working with the Yoast SEO version 21.9 and not working with 22.0. However, the specific permalink structure is not loading the category pages without having the Yoast SEO plugin, is confusing me here.

from wordpress-seo.

josevarghese avatar josevarghese commented on June 8, 2024

Adding notes for the development team to check this further:

Steps to reproduce:

  1. Install the Yoast SEO plugin 21.9
  2. Navigate to the Yoast SEO > Settings > Categories & tags > select the Categories > Disable the toggle for "Show the categories prefix in the slug" and click the Save changes button
  3. Within the permalinks page, set the custom permalinks structure as /blog/%postname%/ and the category as .
  4. Then create a page with slug blog and select it as the post page within the Settings > Reading > Posts page.
  5. After that, create a category with a slug "blog" and create the sub-categories for it
  6. View the category and sub-category pages created, and then you can notice that the category pages are loading
  7. Update the Yoast SEO plugin to the latest version, and all these category pages that were loading before become 404.

from wordpress-seo.

brightcherry avatar brightcherry commented on June 8, 2024

Hi @josevarghese

I think the issue is that there was something in Yoast SEO plugin 21.9 (and below) that gave categories precedence over pages (that's why the category with the slug "blog" loaded instead of the page with the same slug).

That was highlighted as a bug, presumably because the default behaviour of WordPress core seems to give pages precedence (over categories). Since Yoast 22.0 restored the default behaviour, it's been marked as a "bug fix".

That's why you get 404 errors for sub-categories when you disable Yoast altogether (i.e. "blog" is now being read as a page, not a parent category).

But this has left many people with broken permalink structures, because they took advantage of how Yoast used to handle the hierarchy.

Does that make sense?

In any case, do you need any further information from me?

Many thanks

from wordpress-seo.

josevarghese avatar josevarghese commented on June 8, 2024

Thanks a lot for the information @brightcherry.

As we are able to replicate this, we are discussing this with the development team internally. I will keep you posted on this once I get more information from them.

from wordpress-seo.

josevarghese avatar josevarghese commented on June 8, 2024

Hi @brightcherry

We discussed this with the development team internally, and they noticed that the permalink structure you've used is not ideal, as you are using page and category with the same slug, "blog." The category and the page should have unique permalinks, and having both as the same slug causes the URLs to load properly.

As we mentioned within our help center on removing the categories prefix, we clearly mentioned that removing the category prefix can cause unexpected URL behavior and it is not recommended in most cases.

However, in your case, if you remove the . from the category base within the permalink settings page, the category pages will work again. The slug for the category page will then be /blog/{slug_of_your_category}

Based on this, at this moment, we are not planning to make any changes to the current functionality of the plugin, as we won't recommend having the same slug for the page and category to be the same. So, we recommend you to revisit your permalink structure.

from wordpress-seo.

aramshaw avatar aramshaw commented on June 8, 2024

@josevarghese - perhaps @brightcherry 's issue is intended functionality but now I review it in detail my case is subtly different.

  1. I have Yoast "Show the categories prefix in the slug" turned off
    image

  2. I have an (I believe) relatively standard permalink structure
    image

  3. And have removed the "category" prefix in the normal way
    image

Pre-upgrade from 21.9.1 to 22.0.0 my pages work like this:
https://ggenroestaging.wpengine.com/b2b-marketing/social-media (category/sub-category)
https://ggenroestaging.wpengine.com/b2b-marketing/lead-generation (category/sub-category)
https://ggenroestaging.wpengine.com/blog/7-steps-to-best-practice-net-promoter-score-implementation/1392 (post)
https://ggenroestaging.wpengine.com/customer-experience-consulting (page)

Post upgrade to 22.1
https://ggenroestaging.wpengine.com/b2b-marketing/social-media ->404
https://ggenroestaging.wpengine.com/b2b-marketing/lead-generation ->404
https://ggenroestaging.wpengine.com/blog/7-steps-to-best-practice-net-promoter-score-implementation/1392 ->200
https://ggenroestaging.wpengine.com/customer-experience-consulting -> 200

from wordpress-seo.

josevarghese avatar josevarghese commented on June 8, 2024

Hi @aramshaw

Thanks for getting back to us and sharing more details.

The issue you have noticed is that your permalink settings for the category base are trying to remove the category, and then you also have disabled the "Show the categories prefix in the slug" within the Category settings page of the Yoast SEO plugin.

First, kindly note that the . that you have added to the Category base in the Permalinks settings page is to remove the category from the URL. So once you disable the "Show the categories prefix in the slug" within the Yoast SEO settings page, it also tries to disable the category issue again. This means the same functionality that you would like to attain for your category page is enabled twice in permalinks (within the category base) and also within our plugin.

So to fix this, we recommend you to remove the . from the Category base. Once after that, the category pages will get loaded correctly without having the category prefix, as you have disabled the "Show the categories prefix in the slug" in Yoast SEO settings.

We recommend creating regular backups of your site and database for your site's health and safety. A backup is crucial before making important changes on your website and provides you with a safety net if something were to go wrong. Learn more about the benefits of regular backups.

Kindly please let us know the results.

from wordpress-seo.

aramshaw avatar aramshaw commented on June 8, 2024

Hi @josevarghese

Thanks for your suggestions. I have implemented them but it leaves me with the wrong category URL.

Permalinks:
image

Yoast (22.1):
image

URLs have "blog" inserted:
https://ggenroestaging.wpengine.com/**blog**/b2b-marketing/social-media ->200
https://ggenroestaging.wpengine.com/**blog**/b2b-marketing/lead-generation ->200

For Yoast (21.9)
https://ggenroestaging.wpengine.com/b2b-marketing/social-media (category/sub-category)

from wordpress-seo.

josevarghese avatar josevarghese commented on June 8, 2024

Hi @aramshaw

Yes, the blog will be added as a prefix to all the URLs as the Custom structure of the Permalinks contains /blog/ for the whole website.

blog

It's the same issue as I mentioned here., so you need to revisit the Permalinks structure as having the Custom structure of the Permalinks contain /blog/, and when the permalinks contain it then it will be used for the whole website.

from wordpress-seo.

aramshaw avatar aramshaw commented on June 8, 2024

Hi @josevarghese ,

Okay - I see now - it looks like the prior "bug" has been providing the functionality that I actually wanted. I'm going to have to ponder the options here as I can't change the structure now - too many inbound links.

@brightcherry - did you find a solution that I can perhaps copy.

from wordpress-seo.

brightcherry avatar brightcherry commented on June 8, 2024

Hi @aramshaw

Not yet, I'm in the same position as you, unfortunately.

Bit disappointed by the conclusion, to be honest. I think they could have at least provided a hook so we would revert back to the original functionality.

In any case, I'm either going to have to stop using Yoast or see if I can find a workaround with it installed. I was going to look into it later this week. I will let you know if I find a solution.

Similarly to you, changing the permalink structure is not an option.

from wordpress-seo.

aramshaw avatar aramshaw commented on June 8, 2024

Hi @brightcherry ,

I guess I can't be too demanding - I've been using the un-paid version....but yes a hook/option would have been nice.

I'll also have a think about approaches and share anything I find. I'm using Elementor in a slightly hacky way to sometimes show pages instead of category archives.

Will let you know.

from wordpress-seo.

aramshaw avatar aramshaw commented on June 8, 2024

Hi @brightcherry

I've had some success in fixing / keeping my link structure with a small amount of code in the functions.php file. Took a lot of fiddling and support from ChatGPT. Let me know if you want the code - email me at [email protected]

from wordpress-seo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.