I post at SearchCommander.com now, and this post was published 15 years 4 months 7 days ago. This industry changes FAST, so blindly following the advice here *may not* be a good idea! If you're at all unsure, feel free to hit me up on Twitter and ask.
In WordPress, the traditional behavior of the past few months has been that if you edit the Permalink of a page or post, the old URL will generate a 301 (permanent) redirect to the new URL.
This action follows SEO best practices, and in general it follows anyone’s common sense. It tells search engines that the page has been permanently moved, and it also retains the value of any incoming links that may have accumulated for that URL
However, in WordPress 2.82, something seems to have gone wacky, and those actions are no longer happening.
This first came to my attention when I saw a Tweet by johnandrews saying that he was seeing that the old URL was remaining, and the new URL then 302 redirected to the old one.
He and I chatted a bit about it briefly, so this morning I decided to do a quick test for myself, and went to the one and only 2.82 installation that we have, and I changed the Permalink of the post.
While I did not see the old url remaining as John reported, when running the old URL or the new URL through either of these two server response checkers, I was shown a 302 redirect instead of a 301 and I also noticed that the trailing slash is no longer added.
[flash http://pdxtc.com/vids/wp-2.82-permalinks-404/wp-2.82-permalinks-404.flv]
So, I guess the the moral of the story here is don’t change any URLs if you’re running WordPress 2.82 – and changing URL’s really isn’t all that desirable anyway.
This leaves me to wonder what if editing the entire permalink structure on a new WP 2.82 installation might not be wacky too?
*** Update – Yes, it seems that changing the site permalink structure DOES ALSO generate a 302 from the old URL to the new. What a colossal screwup!
*** Update October 2009 –
Now with a WordPress 2.85 upgrade, I’m seeing 404 errors after changing a URL, so it’s even worse! Unbelievable.
How funny. I didn’t even know about that previous behavior. Wish I had 🙂 Many times I have wanted to change the URL but didn’t because links had already gone out, and on some that I just really had to, I actually manually edited the .htaccess.
Yeah, I was doing that too, until someone told me it was “built in” a few months ago! when i think of all the time wasted…
Anyway, thanks Shane, for the comment!
What really bugs me is that we should be able to rely on the WP core (and trust it), compared to how we have to deal with plugins. Plugins authors are basically unchecked and free to innovate (take risks and make mistakes) which is great – caveat emptor. But when the core behaves like this, with no obvious mentions of the change, the whole WP=plugins setup becomes a quagmire.
Have you seen how bad the admin panel looks in the latest release. Unbelievable. I actually liked the previous admin panel very much. But the most recent one is really screwed up in firefox 3 and it overlays a ton of tools across the top of the screen. Really weird behavior overall. I am seriously regretting updating right now.
Scott — I authored both these features, and I wasn’t aware of any changes happening to them in WordPress 2.8.2. The feature still works as intended with 301 redirects and trailing slash preference preservation on all of my WordPress 2.8.2 blogs. I wonder if it isn’t something specific about your server setup or maybe a plugin you have that is interfering.
Any additional info you can provide me would be appreciated!
Wow, thanks for commenting here Mark, but really? You didn’t change them on purpose? Well then somethings screwy, and I’m sure it’s not my server setup. It’s appeared one more than one host (two), and it’s been verified by others here too now.
Try a brand new install, then change the default permalinks, and then try the old default urls – You’ll see that it 302’s now. (I’ll verify tomorrow). Or take an upgraded 2.82 established site that’s had custom permalinks set before, and then edit a single post permalink and check it. It 302’s now, (you can test here or here and it definitely did 301 in previous versions. Thanks again for weighing in, and I hope to hear back from you…
I’ll definitly try a brand new clean installation with NO plugins tomorrow on a new host, and see if the behavior is the same.
Scott — I wasn’t able to reproduce the issue on your site, using the post you used in your screencast. Here’s a screencast of me testing it out.
I’d be comforting to know that Mark was fixing it, and would save us the hassle of hacking the core. Time she’s a running out, though. I hate to see hack plugins show up because they last forever in the search engines, long after the problem gets fixed in the core.
Mark,
Here’s the code I had to edit to get to to work work it’s in the plugable.php file wp-includes
this has my edits sorry didn’t save the original
//if ( php_sapi_name() != ‘cgi-fcgi’ )
//status_header(301); // This causes problems on IIS and some FastCGI setups
header(“HTTP/1.1 301 Moved Permanently”);
header(“Location: $location”);
without the 301 line it returns a 302
Thanks Michael, I was going to try what you emailed me, but I figure I’m safer this way – I break things too easily 😉
I do see the video there, thanks, but I’m not sure what to say!
function “redirect” still is a 302 redirect (see wpp-apps.php line 1351)
sorry – meant to also say that was WP 2.8.3 so there is no confusion. Wp2.8.3 was released last night, and still has the 302.
Mark, if the intent is that they serve a 301 redirect then the feature is not working properly.
I’ve created a quick test installation at http://test.flippingeasy.com that illustrates that it is in fact serving a 302 redirect.
However, I didn’t think this was new behavior for WordPress as I’ve seen it serve 302’s for some time now.
Thanks for taking the time ben – I appreciate it – looks like 2.83 is out now too!
Scott, not a problem. As I mentioned on the other post, this isn’t a new phenomenon to WP 2.8.2 as I currently have older blogs that do the same thing.
Also, I have blogs (2.8.2 and 2.8.3) that are creating 301 redirects when a URL is changed so I’m not sure what the issue is.
Both flippingeasy.com and the site that are using 301 redirects are on the same server so it’s not a hosting issue.
Perhaps its a plugin or theme issue somehow?
Apparently, this weeks hardening release has eliminated ANY redirect at all, and an edited permalink or changed permalink structure simply comes up 404. Wonderful.
Hi, there. I just want to ask you. What is the best way to change our url for SEO? I want to change my current url: site/category/postcontent.html with only the post content without category in permalink but i still confuse about the risk of it. Could you explain the risk in SEO, thank you
No risk, as long as you have 301’s taking place on the old URL’s – WordPress SHOULD d othis manually – they dont always, and as this (old) post shows, they break in different versions. Change how you wish, but check for the 301’s.