WordPress is too popular nowadays that daily new bloggers are adopting it. There are too many free and paid themes are available forWordPresss platform. Every developers has created the design as per his choice and thinking.

Find out Category ID

Currently, I am using “justwrite” theme in routerunlock.com. It is nicely designed and suites our requirements. Since I write about smartphones and tablets specifications, so I create every time a new post under Gadget Specifications category. Since it is just in table format that is no so much user interactive, so I don’t want to see this in homepage and RSS feed as well.

After trying a lot, I got some coding that worked well in WordPress 4.1. If you want to remove the specific category from RSS feed then, try below code :

function myFilter($query) {
if ($query->is_feed) {
$query->set(‘cat’,’-X, X1′);
return $query;


If you want to remove any categories from homepage then use below code :

function exclude_category_home( $query ) {
if ( $query->is_home ) {
$query->set( ‘cat’, ‘-X, X1’ );
return $query;

add_filter( ‘pre_get_posts’, ‘exclude_category_home’ );

Here, X and X1 is your category which you want to exclude. Change it with your category IDs.

Open the theme editor and go functions.php. Go to the end, and paste the code before ?>

Now update the file and it will work, as you like.

To find out the Category ID, login into the dashboard of your blog and go to the Categories. Put the cursor in any category which you want to exclude, Category ID will be displayed just above the taskbar of Windows. Note down the category ID and replace the ‘X’.

There are various plugins are also available, but some are out-dated. You can try with Simply Exclude, or Ultimate Category Excluder. However, we have not tested these plugins. Before making any changes, make you have taken the backup of original files.