Custom Permalinks is a WordPress plugin that gives you ultimate control over your site structure.
Lay out your site the way you want it. Set the URL of any post, tag or category to anything you want. Old permalinks will redirect properly to the new address.
Support not available at this time: Unfortunately, I don’t presently have the resources to offer support for this plugin. Please direct questions to the WordPress forums
Note: This plugin is not a replacement for the inbuilt permalink settings: Custom Permalinks is designed to modify permalinks on a per-post/page/tag/category basis, not for all posts/etc at once. If you wish to alter your entire site structure, spare your sanity, and change the WordPress permalink settings instead.
Download
Download Custom Permalinks for WordPress from the Custom Permalinks WordPress plugin page.
If you like Custom Permalinks, please consider buying one of my products.
Installation
- Unzip the package, and upload ‘custom-permalinks’ to the ‘/wp-content/plugins/’ directory
- Activate the plugin through the ‘Plugins’ menu in WordPress
- Edit any post, tag or category to set a custom permalink.
Configuration
- Open or create a post, tag, or category.
- Under ‘Custom Permalink’, type in a URL, not including the http://domain part of the address.
- Save
Now, the post/tag/category will be accessible at the custom address.
Incoming visitors from old links will be redirected via a 301 redirect to the new address.
See Custom Permalinks in action right here! (See the address you’re currently at?)
Notes
Interacting with other plugins which modify the URL
If you notice that some plugins, such as Keyvan Minoukadeh’s Paged Comments plugin, are not operating correctly, then ensure that your custom permalinks have a trailing slash (or not, if your standard permalinks do not have trailing slashes).
The Paged Comments plugin, and possibly others, work by adding a path component to the URL to signify state (eg. /comment-page-1), then hiding that path component from WordPress.
If you have a custom permalink with a different trailing / configuration to your normal permalinks (i.e., your custom permalink has a trailing / when others don’t, or vice versa), you will notice that these plugins no longer work, because Custom Permalinks is correcting the URL, which overwrites the plugin’s changes.
If you notice this happening, make sure you have a trailing / on your permalink, or remove the trailing slash if your standard permalinks do not have a trailing /.
Hiding the custom_permalinks custom field
A user recently asked for this; I’m not going to include it in the plugin (some people, including me, want to see this field, because we set it manually sometimes), but I’m happy to make a plugin-let to make it happen.
Here it is: hide_custom_permalink_field.php.zip
Put it in your wp-content/plugins
folder and turn it on in Plugins under WP admin.
FAQ
I just get a “404 error” message when I try to visit a custom permalink
Have you configured your default permalinks to be other than the default “?p=123” style? If not, you probably haven’t got URL rewriting enabled. Either set your permalinks to one of the other options (or a custom layout), or add the following to your .htaccess
file in your webroot, creating this file if necessary:
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule>
64 Comments
Hello…nice plugin. Unfortunately I can’t get it to work. When I create tag and then edit a page post, type in the custom permalink, and then try to visit the page the page doesn’t come up. The link is correct, but the page is not found.
I have WordPress 2.9.2 and the latest version of the plugin.
Any ideas?
Thanks
Hi William – I’ve just added your answer to a new ‘FAQ’ section above. Does that address your problem?
I’ve been trying to research this issue to customize my permalinks. I’m getting the same error message. I’ve looked up about the .htaccess edit, but I can’t get it to work. I followed a tutorial where it said to create a text file and save it as htaccess.txt and then include the code that you mentioned:
RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]
Then following the tutorial, I uploaded this into my “www” folder and then renamed the file to .htaccess which makes it disappear. Then my entire site went down. I had to ask tech support to bring it back up. Is there another easier way to update or add the .htaccess file?
Hi David – Best ask your web host support for this one, or, in a bind, the WordPress support forums. It may depend on your web host’s setup.
Great plug-in, thanks very much. Seems like something that should be included in WP options, so thanks for solving my problem! I’ve rated it 5 stars on the WordPress site and “works” with the 2.9.2 and 0.6 version combination. Again, thanks.
Greg
Cheers, Greg! That’s great!
For those having problems and getting a 404 error, make sure the .htaccess file as permissions of 666, so that it can be written to. This fixed the issue for me. Hope it helps :)
wordpress 2.9.2 custom permalinks 0.6
I’m a bit stumped. Maybe I did something wrong. When I create a page and create a custom link, for some reason its creating another page from the homepage where the slideshow images aren’t working…. what did I do? I created a sample problem page called Test Page. Here’s the link:
http://davidchanportfolio.com/blog/testpage
So the custom link works here! Woo! But what did I do wrong? Why is it displaying the homepage like that? I must’ve missed something…..
你的插件相当强大,感谢分享 ^_&
Excellent plugin – thanks for releasing it! I was able to keep my internal page structure with sub-pages for easy menu generation, but define a more SEO-friendly URL structure for the site I am currently working on.
5 stars from me – thanks again!
Great to hear, Elliot – Glad to help =)
Cheers!
This is a great plugin.. I just noticed something though. We just updated to WordPress 3.0 and there is a bug with the “View Page” button when editing a page inside the dashboard.
It returns this when there isn’t a custom permalink defined “http://domainname.com/parent-page/%pagename%/”
The error would be “%pagename%/”
Thanks for letting me know, Derrick! 0.6.1 should fix this
I just updated the custom permalinks plugin to version 0.6.1. My latest post is now giving a 404 error when I try to click on the permalink from the index as well as from category pages.
You can see the latest post on my main page http://theviolent.net/ The permalink is defined as http://theviolent.net/ps-others/dandelion.
If I try to remove the custom permalink by leaving the field blank, and have wordpress define the permalink, I still get the 404 error.
Hi Christopher,
Sorry to hear that! Hmm, all those links seem to be working for me (although it’s odd that both ps-others/dandelion and ps-others/electric-dandelion work).
Does 0.6 work?
Yeah, it was a really strange thing. My first post was called Dandelion. And no matter what permalink I put in, I received a 404. I deleted the post and then added a new post with a different name call Electric Dandelion, and it worked. I couldn’t for the life of me find what was causing the 404 from the first post.
I cannot figure out where to put the .htaccess file? I have serveral website running on my server. Do I put it in the /var/www/html/website1/ ? I put it there and it still does not work. I get the 404 error.
Hi Jeff,
The .htaccess file goes in your webroot. If it’s not working, I’d contact your web host’s support.
I am having a conflict with another plugin which needs to rewrite urls to work. I tried to explain the problem in a comment, but it kept saying it was spammy. So I opened a post on the word press forums explaining the problem.
If you have any ideas on the work around, please let me know. http://wordpress.org/support/topic/413522?replies=1
Thanks for your help.
Hi Michael, Not sure if this was answered already, but does your plugin support adding file extensions (i.e. .php) ?
~ Matthew
Absolutely
Also, the site I am trying to use this on: http://www.online-health-insurance.com/articles/2008/04/
Is using a custom.conf file to handle server-side redirects, so there is no .htaccess, but the custom permalinks are working.
On the link above, you can see two pages I am trying to use your custom permalink plugin on, but I get a 404 error.
Thanks, Matthew
nevermind, our admin had a different rule in the custom.conf that was intercepting the file because of the .php extension.
Hello Michael,
This is an excellent, but I do have one question. I don’t like typing the permalinks for the pages/posts, as I like the default permalinks and would like to keep it so wordpress does it automatically. Is there any way for me to disable this plugin only for posts/pages? I’m mainly using this for only categories.
Thanks, Jordan.
Hi Jordan,
Unless there’s something going wrong with the installation, as long as you don’t specifically provide a custom permalink for a post/page/category/tag, the default will be used. Is there something not working properly?
Great! Didn’t realize that! I’ve tried numerous custom permalink plugins and this is the only one that actually works and does what I need. Thanks for a great plugin! 5 stars!
Actually from what I’ve seen in using the plugin, if a category has a custom permalink assigned and a post in that category does not, it will produce a 404 error for that post.
Cheers, Jordan =)
Actually, this plugin isn’t designed to take the place of WP permalinks, for which you can define a pre-set structure. In Custom Permalinks, a category tag doesn’t affect anything else (like the posts that have that category).
If you want the site organised by category, you just need to use the built-in permalink preferences to do so; set your permalink to %category%/%postname%/ for instance.
If you’ve already got that structure set up, and you assign a custom permalink to the category, it’s actually not going to change the permalinks of the posts underneath the category – the way the WP permalinks system works, the %category% placeholder refers to the category’s slug, and not its physical URL.
If there’s enough demand, I may be able to find a way around that limitation, but there hasn’t been so far =)
I appologize, I didn’t quite follow what you were saying. My wordpress permalink structure is defined as you said “%category%/%postname%” But I use your custom permalink to remove the child-category nesting from the url.
For example I have a category called grunge. The wordpress permalink defines it as root/art/photoshop/grunge. I use the custom permalink to define it as root/grunge.
If I forget to add a custom permalink definition on a new post in the grunge category, the post takes on the wordpress default permalink, but generates a 404 error. Any time I forget to define the custom permalink for any new post, it defaults to the wordpress structure, but always generates a 404 until I go back and define the custom permalink.
Ah yes; so this occurs because of the way WP’s permalinks are implemented, where %category% refers to the slug of the category, and not its physical URL (which Custom Permalinks can change).
I may have a look at this one day, see if there’s any sensible way to work around it, but for now, I guess keep doing what you’re doing =)
It only happens when I am dumb and forget to define the custom permalink. But it was the reason I asked once about the possibility of post inheritance where the post inherits the custom permalink structure of the category.
For example: all new grunge posts would by default have the custom permalink root/grunge/newpostname
Hi sir thanks for your plugin. it helped me lot to move my joomla site to wordpress. Now my probe is i cant get wp permalinks work with this plugin. i need to type url for each and every post . It is lot of pain to add url manually as i,am updating blog daily 10 times. Plz help
thanks
Any chance this plugin would make 404 requesetsredirect to index.html or home?
Nope, but you could probably do that by adding
<?php header("Location: /"); ?>
to 404.php in your template.Another suggestion: ignore uppercase and lowercase.
Hi Michael.
Thanks for this nice plugin. I have some posts published under the category “cat1” an the permalinks like this: /%category%/%postname%/. I edited the cat1 permalink to appear like “supercategory/”. So my question is: Is there a way to make the posts under cat1 to have a permalink like: supercategory/%postname%/ instead of cat1/%postname%/ automatically?
Thanks for your support.
Cheers Hernan! I’m afraid not, at least not yet – you’ll need to set the permalinks manually. I may do this at a later stage, though.
We have converted over a website from asp to WordPress and are using the custom permalinks plugin to keep google happy. After the migration we started seeing a massive amount of 404 errors on google wmt’s. Some of the links look like this: …. and obviously do not link back to correct pages. We have run link checkers as well as Xenu and cannot find out where google is getting these errors. I have to admit we are stumped. Do you have any clue where we might look?
No idea I’m afraid, JR
Michael,
Thanks for looking. I submitted a modification to the sillybean html import tool for WP that integrates with your CP plugin. I have a copy if anyone is interested. It works great for importing a whole site of html(or other) and keepin the links the same. I think Steph ay Sillybean is going to integrate it into her next release. Thanks for the great tool.
JR
Hi Michael. Great plug-in… I’d have it in my host without any problem, but now I need to use it in a web host wihtout mod_rewrite on. Is there any way? Thanks, for your time. Cuyo
I’m afraid not, Cuyo – it’s mod_rewrite only
thanks for your quick response. It is a pity that can not be used without mod-rewrite, but it is logical …. mmmmm … do you know any plug-in to do the same (custom url 100%) without mod-rewrite?
Actually, it just occurred to me that there’s something you could test – Try setting the permalinks as being prefixed by a “?” – like, “?my-custom-permalink”. It may actually work…
thanks michael, it’s a good idea … And it works! but don’t you think this symbol “?”, indicating session, could it difficult to read the URL by google robot?, what do you think?
That’s good – you could also try replacing the ? with “/index.php/”, like /index.php/my-custom-permalink.
Great plugin! What is its status in terms of WP 3.0 compatibility? Seems to be some conflicting info out there. I’d love to upgrade our site to 3, but we depend on Custom Permalinks for several of our most heavily trafficked posts.
I’m using it on 3.x with no problems, and haven’t heard anyone else report any issues
i have spent over 4 days now searching for exactly this functionality. YOU ROCK
Hi Michael. (already PM’ed you)I love this Great plug-in too… I’ve put it in my host without any problems, I used the 0.6.1 version Thanks, for the help and your time. DER6K
Hi, Thanks for this great plugin. I want to use it in my migration from a static site to wordpress. My old pages should keep their linkjuice.
However, i’ve one problem. The custom permalink works great if I use no extension or html, but it fails if i use .php. When I open such an article on its new location I see the error that it isn’t there.
You can see my blog at i n f o s i t e s . b e / blog (without spaces) My permalinks setting in WordPress were /%category%/%postname%/ (bit this gave me the error that i was in an infinite loop) so I changed them to /%category%/%postname%
Can you help me with this?
This sounds like probably an issue with your host – I’ve heard this one before, where the web server’s configured to always try to find a PHP file, regardless of the URL rewriting settings (or something). I’d get in touch with them.
Hello,
I just post a issue on the WordPress Support forum:
http://wordpress.org/support/topic/plugin-custom-permalinks-issue-wtih-permalinks-for-child-pages?replies=1
Regards,
Walter
This plugin is very handy and helped me a lot for a wordpress newbie like me ..who is trying to learn seo :)
Michael, Could you pull up my blog http://www.wiseseoservice.com/blog and click on the permalink at the top of each post. It is giving me a 404 error and sending me to a 404 page. Any idea what is causing this?
Thanks, Mike
Without seeing your backend setup, I couldn’t say, Mike, but I can recommend that if having those nice URLs for each post is all you’re using this plugin for, you shouldn’t be using this plugin: Just set your permalinks up in WordPress instead, as it’s supported out of the box.
Custom Permalinks (the plugin) is really only for giving some posts out-of-the-ordinary permalinks that don’t fit the standard template (like, for me, having this page at /wordpress/plugins/custom-permalinks instead of just /custom-permalinks).
Michael thanks a lot for replying so quickly. Is there any other way to contact you besides here(email, chat etc..). I would like to talk to you more about setting this up in wordpress instead of using the plugin. I am using an autoblogger which is taking RSS feeds and displaying on my blog..
Thanks again Michael.
I’m afraid I don’t have the resources to help you with blog setup – please post on the WordPress forums, where someone will be able to help you.
Cheers, Michael
God Bless you man! Thanks a lot for this plug-in. You don’t know you have just saved my hard work from going into vain :)
I posted many posts with default permalink then I created a page with custom permalink settings, submitted that page as reciprocal link page on more than 50 directories. Then I realized that all my posts are not accessible. If I changed my permalink back to default everything was ok but link page was giving 404 error. With this plugin I have default permalink for all my posts and customized for that page. :) Thanks you
I want to be able to use underscores instead of dashes in my page names, and end my pages with .html . Can I do this? Having a blog entry called Study Guides, I could have a link that says http://www.123collegedegree.com/updates/Study_Guides.html
I also want the ability to make the letters all lower case, i.e. http://www.123collegedegree.com/updates/Study_Guides.html vs http://www.123collegedegree.com/updates/study_guides.html
I hope you can point me in the right direction. Thanks.
Hey – Unless I’m mistaken, this sounds like you want to modify the original permalinks, which you’re better off doing in Permalinks settings, rather than using a plugin.
they use dashes – rather than underscores _
Can you go into a bit more detail regarding the 404 error fix as I’m having that same problem!?
I am an internet idiot and hate everything about it as it’s always a pain so some help would be much appreciated!
I don’t know which folder to put the .htaccess file, what to name that file, how you find out if you already have that file and how to create it if you don’t (why wouldn’t you?).
Some sort of step by step guide to would be fantastic as it seems that when this plugin works, it is great – it’s what I’m looking for!
Great tool! I have one question: Is there any way to specify that the custom permalinks option only appears on categories, for examples, and not on posts or pages edit screens? I run a multi-user blog and our contributors started getting creative with custom permalinks, giving my editor a headache. It woudl be great to have a preferences menu that says: “Allow custom permalinks on (check many): Categories, Tags, Posts, Pages.
Thanks again for a great tool!