Exclude Category from Recent Posts in WordPress

In this little guide I will show you how to exclude a category in your recent posts in wordpress. Most tutorials I found online required php code to get the job done. I decided to show you a more simple method using a great plugin called ‘Recent Posts Plus’.

After installing the plugin,  you should have a widget called ‘recent posts plus’. The default WordPress widget recent posts has no use. Drag the widget to the sidebar or where you would like to have your recent posts.

Now to exclude a category from the recent posts. Under the widget’s options check the box expert options. Under the heading WP_Query Options you can use the code below to exclude the category with the id ’27’.


1
2
3
{
"cat": "-27"
}

You need to replace the number 27 with your category id that you would like to be excluded. You can go to edit the category to find the id inside the url.

There are other features that this plugin is capable like skipping posts or including the author’s name. For more information visit the documentation on the recent posts plus plugin.


Leave a Reply

Your email address will not be published. Required fields are marked *