An Awesome Hidden Feature In WordPress You May Not Know About

January 25, 2012  | 
5 Comments

An Awesome Hidden Feature In WordPress You May Not Know AboutNow if this feature is common knowledge then feel free to call me out, but I have been a WordPress user for some time and had no idea that it existed. Not only that, I could have saved myself a fair bit of time on occasion if I had known about it.

How often do you get the temptation to change the permalink of a post after you have published it? There are a few different reasons why you might – here are some of mine:

  • WordPress’ interpretation of the post title resulted in a mangled permalink (no one likes “%20″s and “—”s in their permalinks, right?).
  • You started with one title, then edited it before you hit Publish. The permalink is still based upon the original title.
  • You’re going back through some old posts and re-editing titles and permalinks to make them more search engine friendly.
  • You just plain don’t like the permalink that WordPress created (perhaps it is far too long), but didn’t notice before you hit Publish.

So, changing permalinks is often a necessary evil. Before I knew of WordPress’ hidden capability, effecting the transition was a real pain. I would use the Quick Redirect Plugin to prime the redirect from the old URL to the new URL, change the permalink in the post screen, then hit Update on both pages as quickly as possible. Bit of a pain – and easy to get wrong.

Redirects

Redirects - complicated.

It turns out that a much better alternative exists, which is to simply do nothing. That’s right folks – if you change a post’s permalink, WordPress will take note and create a redirect from the old to the new, without you having to lift a finger.

Now I’ve had a good dig around and was unfortunately unable to discover what type of direct that WordPress applies to the old permalink – but I suspect it is a 301. If anyone knows for sure, let us know in the comments section.

One last thing – this functionality does not exist for Pages, Categories or Tags. The reason for which is beyond me. Answers on a postcard!

Creative Commons images courtesy of tm-tm and Nadya Peek

Featured Plugin - Add bottom corner (or anywhere else) chat to your site

No javascript required, no third part chat engine, just fully featured chat right in your own database on your own WP sites - couldn't be easier.
Find out more

Featured Plugin - Turn any WordPress page into a fully featured wiki!

To get a wiki up and running you used to need to install Mediawiki and toil away for days configuring it... not any more! This plugin gives you *all* the functionality you want from a wiki, in WordPress!!!
Find out more

Featured Plugin - Easily integrate your WordPress site with Facebook

Would you like to add Facebook comments, registration, 'Like' buttons and autoposting to your WP site? Well, The Ultimate Facebook plugin has got that all covered!
Find out more

Featured Plugin - Every great SEO tweak you need, in one snazzy bundle

Fully integrated with the SEOMoz API, complete with automatic links, sitemaps and SEO optimization of your WordPress setup - this is the only plugin you need to help you rank your site number 1 on Google - nothing else compares.
Find out more

Featured Plugin - WordPress + Google Maps = Perfect

Simply insert google maps into posts, sidebars and pages - show directions, streetview, provide image overlays and do it all from a simple button and comprehensive widget.
Find out more

Featured Plugin - Send beautiful html email newsletters, from WordPress!

Now there's no need to pay for a third party service to sign up, manage and send beautiful email newsletters to your subscriber base - this plugin has got the lot.
Find out more

Featured Plugin - Start your own Quora / StackOverflow / Yahoo Q&A site

It's now incredibly easy to start your own Q&A site using nothing more than WordPress - The Q&A plugin simply and brilliantly transforms any site, or page, into a perfect support or Q&A environment.
Find out more

Featured Plugin - Start Your Own Powerful Membership Site

If you're thinking about starting a paid, or just private, membership site then this is truly the plugin you've been looking for. Easy to use, massively configurable and ready to go out of the box!
Find out more

Featured Plugin - Open an Online Store with MarketPress

Out of all the WordPress ecommerce plugins available, this has got to be the winner - easy to configure, powerful functionality, multiple gateways and more. A simply brilliant plugin!
Find out more

5 Responses to An Awesome Hidden Feature In WordPress You May Not Know About

  1. ever heard of post_id? Here. Have a cookie.

  2. Hi :) i’m not a developer but i found that wp use the post id, the numered permalink to identify a post; so if u use nice written permalink u can change it but the post id remains the same. Obliviously all the links system has to be made with default permalink to not get 404, and not with nice permalink. Bye!

  3. This is one of those things I’ve spent months trying to explain to some clients. They don’t get it, so they argue…a lot. It’s good AND BAD.

    This uses a 301 redirect. It is based on a “_wp_old_slug” row within the post_meta table. You CAN add your own to this table to to make it consume additional URLs (say, you’re switching from another platform to WP). However, doing so consumes the string from meta_value whenever it’s used. That means that if you don’t manually prune this table, you can end up with a previous post named ‘blog’ preventing your URLs for buddypress from working correctly. This was a huge problem for a client last year and it took me hours to discover the source of the problem. The fix was to delete the previous “_wp_old_slug” from the postmeta table in order to prevent it from consuming all requests with that four letter word.

    Bottom line: this is EXCELLENT behavior as long as you are keeping tabs on it and aren’t the kind of person to use one-word titles. If you DO use a one-word title, expect things to get ugly when you use that word again later on. Very ugly. ESPECIALLY if you change the URL at some point FROM the one-word slug to a longer slug.

    • Hi Shawn,

      Thanks for the lowdown of how this can go wrong; appreciate it. Glad to see it’s a 301 redirect, but clearly it’s not advisable to be doing it all of the time!

      Cheers,

      Tom

Click on a tab to select how you'd like to leave your comment

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting