sCategory Permalink

Posted by Dmytro Shteflyuk on

Plugin allows to select category which will be used to generate permalink on post edit page. Use custom permalink option %scategory% on Options/Permalinks options page.


  1. Download and unpack plugin files to the wp-content/plugins/scategory-permalink directory.

  2. Enable sCategory Permalink plugin on your Plugins page in Site Admin.

  3. Open the Options/Permalinks page in Site Admin and use %scategory% option in Custom Structure text field (you can look here for other options). In this blog I’m using /%scategory%/%postname%/ structure.

  4. When you move your mouse over category in Categories box the Primary link will appear on the right.

    Choose a category for permalink generation

    Click it to set the category which will be used to generate permalinks. It will be highlighted with bold.

  5. Have fun!


  1. Download and unpack plugin files to the wp-content/plugins/scategory-permalink directory.

  2. Open the Options/Permalinks page in Site Admin and and click Save Changes to re-generate permalinks.

  3. When you move your mouse over category in Categories box the Primary link will appear on the right. Click it to set the category which will be used to generate permalinks. It will be highlighted with bold.


I have recorded a small screencast on how sCategory Permalinks works starting from version 0.6.0:


Plugin works pretty well with the WordPress 2.7.0 — 2.8.2. Hey users of WordPress 2.7.0, could you explain why do you use so old buggy crap? Use new one instead, at least it looks more beautiful!


Latest version of sCategory Permalink is 0.6.2, and it could be downloaded here:

version0.6.2DownloadsCategory Permalink

Also you can download older versions from plugin home page on (but do you really need this old stuff?).

Frequently Asked Questions

Q. Every page on my site responds with error 404
A. Go to Options/Permalinks page in Site Admin and click Save Changes to re-generate permalinks.

Q. First category is used for permalinks instead of selected
A. Check the permalinks structure you used (Options/Permalinks). You should use %scategory% instead of %category%.

Q. I love this plugin. How to do a favor to the author?
A. Just vote for this plugin on And thank you!


If you have any suggestions, found a bug, or just wanted to say “thank you”,– feel free to contact me. Promise, I will answer to every message.

If you want to contribute your code, see the Development section below.


Sources of this plugin are available both in SVN and Git:

Feel free to check them out, make your changes and send me patches. Promise, I will apply every patch (of course, if they add a value to the product). Email for patches, suggestions, or bug reports: [email protected]. Also you have much more ways to contact me.


  • 0.6.2 (July 30, 2009)
    • Nothing really changed. Just to force WordPress to update version.
  • 0.6.1 (July 30, 2009)
    • Fixed blank page when post edit page requested.
    • Fixed “Primary” link appear on all sub-categories, when category selected.
  • 0.6.0 (July 30, 2009)
    • Client side script completely rewritten. New visual look and better usability (thanks to Nikolay Kolev).
  • 0.5.0 (July 28, 2009)
    • Fixed problem with Subscribe2 plugin (thanks to Paul Wagorn).
    • Performance improvement (update meta tags only once per save).
  • 0.4.0 (July 21, 2009)
    • Fixed not-found bug when /%year%/%scategory%/%posttitle% permalink used.
    • Fixed not-found bug when paged comments enabled (/comment-page-N).
    • JavaScript rewritten using jQuery library.
  • 0.3.0 (April 4, 2008)
    • Fixed bug when pages was not found in WordPress 2.5.
  • 0.2.2 (May 20, 2007)
    • Sometimes radio buttons was not displayed (thanks to Vince Caughley and Sam Keen).
  • 0.2.1 (Apr 1, 2007)
    • Removed dependency on deprecated WordPress 1.5 function wp_get_post_cats.
  • 0.2.0 (Mar 30, 2007)
  • 0.1.0 (Nov 18, 2006)
    • Initial plugin implementation.

Other plugins

Full list of plugins I have implemented is available here.

125 Responses to this entry

Subscribe to comments with RSS or TrackBack to 'sCategory Permalink'.

said on October 16th, 2009 at 01:32 · Permalink · Reply

Really awesome plugin, and it works as prescribed, but I had another use in mind:

I wanted to use this in conjunction with the “All in One SEO” plug-in to append the primary category to the end of the post title, but it looks like the %scategory% variable doesn’t work in this context — any ideas?

said on October 16th, 2009 at 12:12 · Permalink · Reply

I will check how I can penetrate to the All in One SEO Pack logic to get sCategory Permalinks working with it. Thank you for you report.

said on October 18th, 2009 at 16:27 · Permalink · Reply

Hi Dmytro,

That would be a very very nice addition to this plugin. I discovered just today that my URLs wearen’t matching with my All in One SEO Pack titles and I tried the same as kadavy without success.

Thanks for looking in to it!!!

said on November 16th, 2009 at 22:21 · Permalink · Reply

Hey Dmytro, really great plugin, I’ve been using it for months and WP should have this feature by default!

Thanks a lot for maintaining it and BIG thanks for supporting all questions and bug reports ^^

said on April 4th, 2010 at 15:26 · Permalink · Reply

I found that by using your plugin, it would change image attachment links and cause a 404. For example, i have an image on my post which links to the attachment page. When you click on it, it gives you a 404. It seems that with this plugin enabled, it strips “attachment/” from the link URL (or doesn’t add it back on). Are you aware of this and do you have a fix?
I have had to completely remove this plugin.

said on September 12th, 2011 at 20:52 · Permalink · Reply

This is just what I need. It works as far as the url resolving, but I can’t get it to print the category name in the template I am working on. The instruction:

$scategory = get_post_custom_values("_category_permalink");


print $scategory[0];

will yield the category number. How do I get it to print the category name?

said on November 29th, 2011 at 00:04 · Permalink · Reply

It works nicely in WordPress 3.1.2. I even don’t loose old permalink that was based on ‘Day and name’ permalink structure.

But I’m still not sure about the function of Primary link on Categories box. I tried to click one category as primary when I have a post with multiple categories, but the permalink stayed the same. Nothing changed. But it always generates permalink from main category to sub-category, so I guess it is working just fine for me.

Thank you very much! :)

said on December 16th, 2011 at 03:02 · Permalink · Reply

Seems that this breaks with WPv3.3 due to the new base-category over-ride fix. Anything using /%scategory%/ goes into an infinite redirect loop. Any ideas?

Alonso Rodriguez
said on December 17th, 2011 at 19:23 · Permalink · Reply

Hey man,

It does not work with the new version of wordpress 3.3

said on December 19th, 2011 at 12:37 · Permalink · Reply

Hello I have activated the new version of wordpress 3.3 and the scategory the plugin does not work anymore! You can update it by finding a solution? Thanks, your plugin is very useful for me.

said on December 23rd, 2011 at 02:41 · Permalink · Reply

I’ve used this plugin on a site for a few years, but today I updated WP to 3.3 and the plugin causes 404 errors on all posts. I noticed that the permalink code that WP adds to .htaccess is different now, so I think the plugin can no longer work with WP.

Please let us know if you make an update that will work with WP 3.3.


said on May 18th, 2012 at 19:57 · Permalink · Reply

Does this plugin work on current versions? All the comments date back to 2009 and before.

If not, does anyone know of another plugin?


said on January 17th, 2014 at 10:28 · Permalink · Reply

Здравствуйте. При обновлении до версии 3.8 выдает 404 ошибку и повторная активация плагина не помогает. Что еще можно сделать? Спасибо

More comments: 1 2 3

Post a comment

You can use simple HTML-formatting tags (like <a>, <strong>, <em>, <ul>, <blockquote>, and other). To format your code sample use [cc lang="php"]$a = "hello";[/cc] (allowed languages are ruby, php, yaml, html, csharp, javascript). Also you can use [cc][/cc] block and its syntax would not be highlighted.

Submit Comment