Tag Archives: category base

How To Remove The Category Base From WordPress Permalinks?

You can remove the base category slug in the WordPress permalinks structure. Earlier this was done with the help of a plugin or PHP function but now you can do it from your admin area dashboard.

By default the category URL on WordPress looks something like this – yourdomain.com/category/category-name, now we have to remove the category from the permalink so that URLs should look something like this yourdomain.com/category-name/.

These steps allow you to remove the category prefix completely by modifying your site’s permanent link settings.

  1. Navigate to your WordPress dashboard
  2. Navigate to Settings -> Permalinks page
  3. Scroll to Custom Structure and put ‘/%category%/%postname%/’.
  4. Go to Category Base and type in a dot “. “
  5. Save your changes.

The category prefix is removed by typing the dot in the category base field. It completely removes the mandatory category base from the category permalinks, so the category name comes right after your domain name in the permalink structure.

By default, this field is left blank which represents the default prefix.

Alternatively, you may add the following rule in .htaccess file present in the root directory of your website :

RewriteRule ^category/(.+)$ https://www.yoursite.com/$1 [R=301,L]

This also removed the category base, don’t forget to replace yoursite.com with your domain. The same can be done with the help of the Yoast SEO plugin. If you are using it on your website simply navigate to Yoast SEO -> Search Appearance and open the ‘Taxonomies’ tab.

Scroll to the Category URLs, select ‘Remove the categories prefix’, and save the changes.

WordPress Dashboard Interface For Controling Permalinks And .htaccess File

Now you can customize and control permalinks structure and .htaccess file direct from your WordPress admin areadashboard. WP htaccess Control should really be called as htacess and Rewrite Control plugin. The plugin provides you an easy interface for customizing htaccess file generated by WordPress and also its permalinks structure of author, category, archives, pagination and custom taxonomies.

Continue reading WordPress Dashboard Interface For Controling Permalinks And .htaccess File