1

With wordpress 3.9 apparently some changes were made to how permalinks work internally.

It seems that in my case these changes have caused some previously working pages to start returning 404 errors.

Most of these problems apply to old posts written years ago when I presume Wordpress did not do such a good job of creating the permalink slug from the post title. So an old post might have the title

Ornamental design - Floral background

Which in my old post created a permalink of:

/articles/2184/1/Ornamental-design---Floral-background

Not very nice with the 3 dashes in there but at least it works. Now with 3.9 that is no longer the case.. the above permalink has stopped working and returns a 404.

To fix this I have to go into wordpress, locate the post and press update.. which updates the slug internally changing it to what it should be:

/articles/2184/1/ornamental-design-floral-background

The problem is that this is effecting over 700 posts and I don't really want to have to locate each post in Wordpress admin and press update. I also have the added problem of the old url now returning a 301 after the update so I also loose a bit of Google PR because of this.

My question

Is there any way I can get WP 3.9 working with my old (not very nice) URLs? And if not is there any way I can bulk update the posts to correct the URL?

1 Answer 1

1

If you have access to your database you can run the following query. I had run into a similar issue a while back.

UPDATE wp_posts SET post_name = REPLACE(post_name, '---', '-')

This will bulk replace every '---' with a single '-' in the post_name. It may also be wise to run the same command on the 'guid' field.

Perhaps someone has a better solution, but this worked for me in the past.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.