
WordPress is my favorite blogging platform but it’s not perfect by all means. There’s still a number of features I would like to see in WordPress, one of them is having the categories to not appear in my url.
I’ve seen and tried various plugins and WordPress hacks but I’m not completely satisfied with the end results.
For Example:
Suppose you have the following url that points to your Health category.
http://www.whatever.com/category/health/
I really hate to see the word category appear in my url, what I want to see is the following:
http://www.whatever.com/health/
Not only does this look nice and clean but it is also great for SEO purposes!
Well here is a very simple solution to this WordPress dilemma, forget those other hacks and plugins!
STEP 1
Let’s dive into your WordPress directory, open up the wp-includes folder and open up category-template.php with your favorite text editor…btw you might want to try using Notepad ++, you can download it here.
STEP 2
Go to line 70 and find the following code:
$catlink = str_replace( '%category%', $category_nicename, $catlink );
Right underneath the code add the following code:
$catlink = str_replace('category/', '', $catlink);
STEP 3
*This is a crucial step to avoid 404 errors when going into your category pages.
Log in to your WordPress admin panel – go to Settings - Permalinks.
Under Common Settings select the Custom Structure radio button and type in the following:
/%category%/%postname%/
or
/%category%/%year%/%monthnum%/%day%/%postname%/
or
/%category%/%year%/%monthnum%/%postname%/Depending on how you want your URL structured…
Click on the Save Changes button and that should be it. Good luck!
Related posts:
- Reverse The WordPress Comments From Newest To Oldest If you want to display your comment list from newest...






that’s very useful! thank you!
Reply To This Comment
Pages
Featured Template
Recent Comments
Connect With Me
Twitter
StumbleUpon
Facebook
FriendFeed
LinkedIn
RSS Feed
Check out my about.me profile!
Latest Testimonial
"As the project began, Jon led me through process, and the final product is better than I could have imagined!" [ ...read more... ]