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>
Related posts
- Private Tags WordPress Plugin The “Private Tags” WordPress plugin allows users to specify a...
- Smart 404 for WordPress Save visitors to your Wordpress site from unhelpful 404 errors!...
- Taking the 404 further Update: I have now written a WordPress plugin that does...
- Hidden Tags WordPress Plugin Hide certain tags/categories from the public...




358 Comments
@Michael
It works. Thanks so much!!!
Michael, this plugin used to work great but now after a few WP upgrades it seems to have stopped functioning for Categories. I go into Edit > Category and customize the permalink as usual, but it doesn’t record the change: if I then come back into Edit > Category, the old permalink is still there.
Also, should there be two Custom Permalink fields or just one? Will send a screenshot to your email. Thanks. Vishnudash
Hi there,
I have installed your plugin but I don’t see anywhere on a post that says “Custom Permalink” for me to set this. Do you have a screen shot of where on the edit page I would see this?
Also, does this plugin work for pages, too, or only posts? Thanks!
Hello Thanks for the great plugin. There is just one thing I can’t seem to make work and I’m pretty sure it’s related to this plugin. I’ve set up my permalinks to use .shtml at the end. Now when I try to set the page I want to load as the homepage under settings- reading – static front page, I get a 404 error when visiting the homepage. The home URL. However, all the other pages and posts work. Any idea how to fix this? Thanks in advance.
I still can’t get it to work, either. I don’t see where the ability to change a permalink appears in a post or a page. Could someone provide a screenshot so I can verify if it’s working correctly, please?
It works for me okay, but not when I enable the Transposh translator plugin.
Can someone help me fix this error?
Any link I have used custom permalinks on, will cause an infite redirection loop when I also try to translate that page.
Great plugin, it solved my problem!
I have some issues with it though. On some posts it will not save the custom field and when i visist the post it shows 404 Not Found. I can add the custom field manually, and then it works fine until next time I edit the post and update. Then the custom field disappears. I can confirm the custom field actually gets deleted from the database.
I can’t see any pattern why it works great on some posts but not on others.
Any idea why this happens?
I use 0.7.3 together with WordPress 3.2.1.
Michael
Very useful plugin, thanks.
Quick question: It works when the trailing slash is not used in permalinks, example: /%year%/%postname%
When the trailing slash is used, it gives an error: The page isn’t redirecting properly. Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
The error occurs only on pages where I have put a custom link e.g. contact.htm On normal pages it works OK.
Is there a way I can use a trailing slash in the permalink, but still get your plugin to work?
Hey Eric – Ah, bugger, it sounds like there’s a bug in there somewhere. I’ll take a look when I get a moment.
Cheers, Michael
I’m running into this issue as well. For those pages that already have a custom permalink defined it stays, but for new ones the custom field doesn’t get saved. It acts like it does, but then when you go back to look it’s not there. Example: my-custom-name.html turns into my-custom-name.html/ If I try to navigate to that I get a 404.
Hey Mike, does this version solve the problem?
I’m afraid I’m having trouble replicating your problem, Eric. I changed my permalink format to one without a trailing slash, then created a test page and tried all variations of permalink, with and without slashes – everything worked fine for me. Could there perhaps be another plugin that’s interfering? Are you using the latest WP version?
Hi Michael
Thanks for the update, but Version 0.7.5 breaks my site. I was on Version 0.7.3 which worked (as long as I did not have the trailing slash in the permalink).
This is what I find now: If I don’t update a page, it still works OK. The custom link shows up in dark print, and View page works fine.
BUT…
If I click Update, the custom link shows up in very light print, and View page gives this error:
The page isn’t redirecting properly. Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
I am using the latest WP.
I wonder if the clue is that the text of the custom permalink goes faint when the page is updated, implying that the changed permalink is not being recognized correctly?
Where can I get a copy of your older version – as that one worked OK?
Eric
Bugger! I’m sorry to hear that! Would you let me know what the default permalink is (if you delete the custom permalink, then click away, it’ll restore the text field to the default value), and what your custom permalink is? I’ll see if I can recreate the issue here. Also, are you using any plugins that might be interfering?
You can grab all prior version at the wordpress plugin page, under the “Older Versions” link.
Mi Michael, Great plugin… I am wondering if there is a way to mass edit permalinks… I have a few pages, each having many subpages and would like to be able to edit all of them in bulk..or at least have them listed / editable on one page rather than having to go to each page and edit the permalink for that page only… Thanks Chaitanya
Hi Chaitanya,
I’m afraid not, at least not yet – I’m not presently planning a bulk-editing feature at this stage.
Thanks for the speedy reply. All the best! Chaitanya
Mike,
We are using version 0.7.4. It seems as the custom permalink option is not available for Post or Pages but it is available to Categories and tags. Any ideas how to make the field show on Posts and Pages? Currently after the title it only shows permalink but that field cannot be changed. In Categories it shows at the bottom of the page.
Please hel;
Hi Rob – is your WordPress installation up to date?
Michael,
Thanks for your quick response.
We are currently using wordpress 3.0.3.
Rob
I would suggest updating to the latest WordPress version – I can’t guarantee backwards-compatibility, I’m afraid. It’s best to stay up to date anyway, for security purposes.
I’ve had to stick to an older version of the plugin as well. The most recent version won’t save the permalink for a new post. It acts like it is, but after the post is saved, the custom permalink field goes blank again.
Derek
Also, can a custom permalink be reused without any problem? For example, you make a post and use the custom permalink “fattyliver”…so the url is http://domain.com/fattyliver . Later, you decide you don’t want that post anymore, so you delete it.
Down the road, you make another post and decide you want to call it “fattyliver” again. Can you do this without any problem or will it want to redirect to the previous post that isn’t there anymore? Are custom permalinks stored somewhere that you can go in and clean them out?
Thanks, Derek
Sorry Michael, I’ve got one more question for now. Just trying to make sure I use your plugin properly so it doesn’t cause any issues with my site.
What do you recommend the best way to name something is? If you name something without a file extension on the end, will it confuse it with being a directory?
For example, is it better to name something using a custom permalink as:
http://domainname.com/customlink
or better to name it:
http://domainname.com/customlink.php
I was just wondering if the first might cause issues with it being confused as a directory or something. Both ways seem to work, but I wasn’t sure if there were any behinds the scene issues I might not be aware of with the coding and such.
Derek
Hi Derek,
Does version 0.7.6 still have this problem? If so, could you let me know what your permalink structure is, and give me an example of a custom permalink?
The data for the plugin is stored in each post’s metadata, so if you delete a post, it should delete the permalink too.
There aren’t really any restrictions on the kind of permalinks you can use – it’s entirely up to you.
Thanks Michael. Version 0.7.6 seems to work. I think 0.7.5 was the latest I had tried previously which wasn’t working for me. I wasn’t aware there was an even newer version. Thanks again for your helpful response.
Derek
Michael
I did a new install on my local server. Latest WordPress, no plugins installed (except for Custom Permalinks). Changed Permalink Setting to Custom Structure: /%postname%/
This is what I found:
If I added a new page or post, and changed the URL name to say: michael, it gave an error. However, if I changed it to michael/ (i.e. added trailing /) it works.
The problem with that is one cannot have a URL like michael.htm
This is the error:
The page isn’t redirecting properly Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
What do you think?
Hi Eric,
I just tried the same thing, but had some issues replicating the issue.
Here’s the process I went through (WP 3.2.1); did you do anything different to make the error happen?
Incidentally, what server are you running on? It’s not IIS or something, is it?
Hi Michael
Your process is similar to mine. I’m running on a Windows PC with Uniserver. Yours works, mine doesn’t (altho 0.7.3 worked for me!)
I’ll try it on a live site and see what happens.
Eric
Hi again Michael
I tried it on a live site hosted on Lunarpages (Apache / PHP / MySQL ) and got the same problem.
Are you doing something else perhaps? What about .htaccess?
Eric
How odd! My test was on a stock installation, empty .htaccess, no plugins enabled, Apache 2.2.19, PHP 5.3.6.
Hi Michael, I’m also having issues. Can you check if this can be done?
My original link is: http://www.domain.com/index.php?page=my-first-page
I would like to retain the same: http://www.newdomain.com/index.php?page=my-first-page
Without your plugin, wordpress removes (.), (?), and (=). Using your plugin, everything looked alright until I click on preview or view page which goes to the home page or the index page. Anything we can do about this? Thanks!
Hi Ramon,
Custom Permalinks is not the thing you want, if you’re changing domains. I’d google “WordPress domain migration” (or similar) to find out how to do it, or ask on the WP forums.
Cheers, Michael
Hi Michael. Thank you for the quick reply and sorry for the misunderstanding.
I’m actually converting a non-wordpress site into wordpress. I’m building the pages already but would like to retain the actual composition of the links. WP automatically removes ., ?, and =. The “newdomain” is just temporary place for the wordpress pages and is not published.
This is where I’m using your Custom Permalinks. The problem is, the old site uses /index.php?page= in their links. When I change the permalinks using the plugin, it is linked to the /index.php page.
Sorry if this is a bit confusing or if the plugin is not meant for what I’m doing.
Thanks!
-Ramon
Ah, okay, that’s a bit clearer. I’m afraid Custom Permalinks still isn’t what you’re after, though. WordPress isn’t designed to be used with permalinks using URL parameters. If it were me, I’d be abandoning the old structure and using a new permalink format, then writing a mod_rewrite directive in your .htaccess to redirect from the old style to the new style.
Something like:
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} ^/index.php\?page=(.*)$ RewriteRule (.*) /$1 [R=301,L] </IfModule>Hi, we use your plugin for two sites and are having a problem. The plugin was working perfect for us but I updated the plugin with the new update and now, it is not allowing me to save pages with a .html at the end AND all blog posts that we have published that had a .html at the end have all of a sudden been changed to a -html at the end which is a big problem because of links we built to the .html pages. This is one of the pages for reference http://www.houstonaccidentsattorneys.com/what-are-punitive-damages-html It used to be http://www.houstonaccidentsattorneys.com/what-are-punitive-damages.html
Do you have any suggestions as to how we can fix this?
Thanks,
Celeste
Are you using 0.7.6, Celeste?
when post_name contains some special chars, it will saved as urlencode format in database like ‘%e3%f3…’. so the $originalUrl will be the urlencoded format, you should urldecode it before it send to $wp_Query, or $wp will urlencode the url again, and will give a 404 error.
in the lastest version 0.7.6, as line 213 additional codes below: if(strpos($originalUrl, ‘%’) === 0) $originalUrl = urldecode($originalUrl);
Ah, nice one, cheers! I’ll roll this in.
Hello Michael, I’m experiencing similar problems to the others in this thread: - http://drc.thosedewolfes.com/resource/fibromyalgia-support-group/ — this should be a custom permalink to the page, but I get a 404 - version 0.7.7 of custom permalinks - version 3.2.1 of WordPress - this url is built with a Custom content type (named resources). When l looked in the wp_post_meta table I see the custom permalink for this post. - Linux environment - this is my .htaccess file
BEGIN WordPress
RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]
END WordPress
Do you have any suggestions? I have an .htaccess file– should I remove that altogether or modify it in some way? There is the WCS Permalink Hotfix plug-in. I tried it and deactivated it as it did nothing make it better or worse.
All the best,
Mike DeWolfe
sorry– that .htaccess file was split into lines but the comment posting stripped the pre tag and smashed it together.
BEGIN WordPress
RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]
END WordPress
I think this is a workaround that worked for me: - I reinstalled WordPress - That whacked my .htaccess so I returned a stored .htaccess file that I had from before the reinstall. - I set the permalinks to default - I deactivated Custom Permalinks - I re-activated it.
Now it appears to work. I love to know how the reinstall figures into all this why that has a bearing.
According to this post, http://www.johnoverall.com/are-your-permalinks-breaking-since-wordpress-3-1-update/
there is a workaround:
Since the drop and me upgrading to 3.1 on my sites I have been seeing the permalinks break when using anything but the default setting. I tend to use a custom setting of /%postname%/ and it has always worked for me fine until the recent update.
Well what I found was needed was to make a simple change the custom setting in the following manner /index.php/%postname%/ this has solved the issue for me on a few sites. Now there is also a couple sites it has not solved the issue and what I found there was a plugin I really like is no longer playing nice.
Hi Michael,
I have a quick question regarding your plugin, I was trying to remove a category slug completely, so that for instance the uncategorized category just shows posts in the root and other categories have a category slug in front.
I have not been able to get this to work, even when either leaving the custom permalink field blank or with just a / in it, so I wanted to know if what I am trying to do is even possible, when using your plugin.
Cheers, olaf
Hi Olaf,
I’m afraid this plugin won’t do what you want – you’ll want to edit the template, and add a query PHP call to limit posts to the category you’re after. I recommend asking on the WP forums – someone will be able to advise you there.
Cheers! Michael
Hi Michael,
ok, well I will try your suggestion and ask around in the WP forums.
Anyway, thank you for your reply.
Cheers, olaf
Hi. I love this plugin and it’s been working great for me. However, I just updated to wordpress 3.2.1 and the newest version of custom permalinks. Now I am noticing that the 301 redirect no longer functions. For instance, I am getting this url http://www.proctorsurf.com/Surf-Boards/models-home?page_id=24 instead of the http://www.proctorsurf.com/Surf-Boards/models-home I checked my htaccess which still contains the following:
ForceType text/html ForceType application/x-httpd-html
BEGIN WordPress
RewriteEngine On RewriteBase /surf-boards/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /surf-boards/index.php [L]
END WordPress
Can you advise how I can get it functioning again? If I change the permalinks options in wordpress to anything besides default, nothing works. I get 404 errors.
Hi!
Awesome, powerful little plug-in. Easy to set up too!
I’m considering this plug-in; however, my long-term issue is performance. I’ve read from numerous sources online that WordPress permalink structure should begin with a numeric structure tag. The documentation outlines this as well: http://codex.wordpress.org/Using_Permalinks#Structure_Tags
I will definitely use this plug-in for a smaller project; however, I maintain a long-term blog updates five days a week (currently has around 400 posts). Any idea how the plug-in performs with:
If I missed this answer someone, many apologies!
Thanks again for a great plug-in! (Grouchy clients that insist on custom urls will be pleased!)
tried custom permalinks. its working fine on my site. just got one problem…
if my site is http://www.mysite.com/page/wordpress and i used the custom permalink to make it http://www.mysite.com/wordpress, the new link works just fine. BUT if i at least one letter of the new link is capitalized, it won’t work anymore.
is there any way to make the custom permalinks work regardless if the link was capitalized or not?
Hi Josh,
Actually, HTTP is case sensitive, so it doesn’t really make sense to have case-insensitive URLs. If you’re desperate to do so, though (and it will almost certainly damage your SEO if you do), let me know and I might be able to suggest a couple of changes in the plugin.
I really, really don’t recommend it though.
Hi. I love this plugin and it’s been working great for me. However, I just updated to wordpress 3.2.1 and the newest version of custom permalinks. Now I am noticing that the 301 redirect no longer functions. For instance, I am getting this url http://www.proctorsurf.com/Surf-Boards/models-home?page_id=24 instead of the http://www.proctorsurf.com/Surf-Boards/models-home I checked my htaccess which still contains the following:
ForceType text/html ForceType application/x-httpd-html
BEGIN WordPress
RewriteEngine On RewriteBase /surf-boards/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /surf-boards/index.php [L]
END WordPress
Can you advise how I can get it functioning again? If I change the permalinks options in wordpress to anything besides default, nothing works. I get 404 errors.
Love the Plugin, thanks!!
After updating to the current version all of my custom permalinks now have a trailing page id on them. Like so:
http://www.proctorsurf.com/Surf-Boards/models-home?page_id=24
Is there a way to make them all go back to how they were before like so:
http://www.proctorsurf.com/Surf-Boards/models-home
Thanks for your time!
is this going to make the site load up faster than using the wordpress pretty permalinks? Right now my home page takes 8-10 sec, other pages about 3 secs to load up in internet explorer
Hi Ivan,
No, it won’t
Hi, Michael, unfortunately had to uninstall and delete your plugin to be able to edit my permalinks after an upgrade to the latest WordPress (3.2.1). Deactivating wasn’t enough, I had to delete it. Thought you’d want to know.
Hi. I love this plugin and it’s been working great for me. However, I just updated to wordpress 3.2.1 and the newest version of custom permalinks.
But now I am getting a trailing ugly permalink after the custom permalink.
For instance, I am getting this url http://www.proctorsurf.com/Surf-Boards/models-home?page_id=24 instead of the http://www.proctorsurf.com/Surf-Boards/models-home I checked my htaccess which still contains the following:
ForceType text/html ForceType application/x-httpd-html
BEGIN WordPress
RewriteEngine On RewriteBase /surf-boards/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /surf-boards/index.php [L]
END WordPress
Can you advise how I can get it functioning again? If I change the permalinks options in wordpress to anything besides default, nothing works. I get 404 errors.
Thanks very much. I would so appreciate some help getting this solved.
Hi Michael,
This plug-in works very well for me when it comes to all the pages on my site, however, I have the WP E-Commerce shopping cart plug in and am unable to get it to work for the product pages properly. It ends up doing a 301 redirect I believe (according to my sitemap) and also shows the “custom permalink blah blah blah” thing on all the product pages. I tried to use the add-on you created but it also did not solve this issue. I think this plug-in would be perfect for the WPSC SEO but I am clueless to get this to work. Any ideas?
HI. I am really quite desperate to figure out why after updating to the current version of the plugin and WP, I am getting the ugly trailing permalinks. http://www.proctorsurf.com/Surf-Boards/models-home?page_id=24 instead of http://www.proctorsurf.com/Surf-Boards/models-home
I checked my htaccess which still contains the following:
ForceType text/html ForceType application/x-httpd-html
BEGIN WordPress
RewriteEngine On RewriteBase /surf-boards/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /surf-boards/index.php [L]
END WordPress
Can you advise how I can get it functioning again? If I change the permalinks options in wordpress to anything besides default, nothing works. I get 404 errors.
I really desire to get it back to functioning beautifully as it always has. Please advise!!! Thanks very much for your time!
Hey Charissa – I’m sorry I haven’t responded yet, I’m right in the middle of a busy product launch! I’ll take a look at this soon, but until then, have you asked on the WP forums at all? They’re often surprisingly helpful!
Thanks Michael. I’ve scoured the forums and can’t find anything about this particular issue. Was working FINE! After update of WP & current version of CP, only certain pages have the added trailing ugly permalink. Even when I make the link directly to the custom permalink, they add the trailing ugly permalink. I’ve tried deleting the custom permalink, saving, then re-entering it. The weird part is that it only does it on certain pages. I would try uninstalling and reinstalling, but renaming my whole site seems like going overboard if not necessary. I’m suprised nobody else has ever encountered this. I figured there would probably be a process known to fix it. Best on your new product launch!
It seems to primarily be an issue when linking using the ugly permalink. It used to redirect to the custom permalink, but now it link to the custom permalink + adds the ugly permalink to the end. If I create a hyperlink using the actual custom permalink, it seems to work fine for the most part. But it’s odd because it used to automatically redirect to the custom permalink without adding the ugly trailing ending!
Hi Michael,
This plug-in works very well for me when it comes to all the pages on my site, however, I have the WP E-Commerce shopping cart plug in and am unable to get it to work for the product pages properly. It ends up doing a 301 redirect I believe (according to my sitemap) and also shows the “custom permalink blah blah blah” thing on all the product pages. I tried to use the add-on you created but it also did not solve this issue. I think this plug-in would be perfect for the WPSC SEO but I am clueless to get this to work. Any ideas?
But you cant use a different domain, can you?