Do you want to know how to allow users to filter WordPress posts and pages?

Recently, one of our users asked us how to add filters to his WordPress website allowing users to filter posts by category, tag, post types, etc…

In this tutorial, we will show you how to allow users to filter publications and pages on WordPress.

But before we start, if you have never installed WordPress, find out How to Install a WordPress Blog in 7 Steps et How to search, install and activate a WordPress theme on your blog 

Then back to why we are here.

filter WordPress posts and pages

Why let users filter articles and pages on WordPress?

By default, WordPress comes with categories and labels - tags - as a way to sort content into topics and for your users to find them easily.

However, users can only view one category, tag, or archive page at a time and that only shows one type of post.

See also How to allow users to filter articles and pages

What if you want users to be able to filter content in more than one category or more than one tag? How about letting users see posts, pages, and custom post types at the same time?

This type of filtering can be particularly useful when you have a lot of content and want users to be able to filter them according to their preferences.

That said, let's examine how to allow users to filter articles and pages on WordPress.

Allow users to easily filter articles and pages

The first thing you need to do is to install and activate the plugin " Search And Filter ". For more details, see our guide step by step on how to install a WordPress plugin.

After activation, the plugin will add a new menu item titled " Search And Filter »On your dashboard menu. Clicking on it will take you to the plugin usage page with detailed documentation on how to use the plugin.

How to allow users to filter articles and pages

The "Search & Filter" plugin comes with a shortcode that accepts different parameters to display the filter options. You can use this shortcode in a publication, a page or in a text widget.

[Searchandfilter fields = "search, category, post_tag"]

You can also use the shortcode as a PHP tag in a file of your theme as follows:

This will display filtering options with search fields, category categories, and labels.

How to allow users to filter articles and pages

By default, the plugin accepts search fields, for taxonomies, the type of publication and the date of publication.

Let's take a look at another example. This time we're going to include categories, tags, post types, and date fields.

You will have to use a shortcode like this:

[Searchandfilter fields = "search, category, post_tag, post_types, post_date"]

Here's how it will look:

How to allow users to filter articles and pages

Now instead of using the drop down selection field, you can also use the checkboxes and add labels for each field. To do this, you will need to add two more parameters to the shortcode.

Read also When and how to install WordPress in a subdirectory

If you use a separate page to display your articles, you can add this shortcode to the page.

[Searchandfilter headings = "Select categories:" types = "checkbox" fields = "category"]

How to allow users to filter articles and pages

If you use multiple fields, types, and titles, you must ensure that the elements are in the same order for each parameter.

See also 8 WordPress plugins to add a translation system on a blog

Let's see another example. This time, we add categories, labels, and publication type fields with different topics and form field types.

[Searchandfilter headings = "Post type, Category, Tag" types = "checkbox, select, select" fields = "post_types, category, post_tag"]

Here's how it will appear on your website:

How to allow users to filter articles and pages

Please refer to the plugin documentation page for more options for using the shortcode.

You can also use these shortcodes inside a text widget.

That's all for this tutorial, I hope it will help you add search and filter for any kind of content.

Discover also some premium WordPress plugins  

You can use other WordPress plugins to give a modern appearance and to optimize the handling of your blog or website.

We offer you here some premium WordPress plugins that will help you do that.

1. WordPress Automatic Plugin  

WordPress Automatic Plugin is a premium plugin that will help you target and find content from various sources such as: Amazon, Walmart, YouTube, Vimeo and DailyMotion, Feeds, eBay auctions, Flickr, Instagram, Pinterest, Reddits, Twitter, Facebook , Craigslist, iTunes, Envato, and SoundCloud.

Wordpress automatic plugin wordpress create automatic blog  

When it comes to articles, the plugin can extract categories and tags, as well as specific parts of original articles, and convert parts of articles to full post.  It has options to remove all links before publishing, to define the status of the publication to be written or published, to exclude words and phrases, to translate the content before posting, and to automatically define the content. picture to the front.

Discover How to install Wordfence Security on WordPress

You will be able to adjust the settings to ignore messages without pictures, messages that are not in English, and duplicate titles. It supports multisite and automatically adds custom fields to messages. These fields can contain details like title, author, content, image, price, and rating.

Download | Demo | Web hosting

2. Ultimate Learning Pro  

As its name suggests, Ultimate Learning Pro is a WordPress Plugin content protection software for educational WordPress websites. It's a fantastic learning management system (LMS) that will get you started in no time. Ultimate learning pro wordpress content protection plugin

In short, it is an all-in-one solution to create an online learning program where students can join and learn about different topics. Instructors and teachers will also be able to join in and share information with knowledge-hungry users.

To consult also: 6 WordPress plugins to define custom avatars on your blog

It has more features than: Ultimate Learning Pro sports and Ultimate Learning Pro. Whether it's different payment services, course reviews, wishlists, pushover notifications, custom currencies, or scheduled course posting. 

See also 10 WooCommerce plugins to customize the appearance of your products

Ultimate Learning Pro works seamlessly with other learning platforms E-commerce and management of members' space, such as WooCommerceEasy Digital Downloads et Stripe to name a few. For a small fee, you can now build your own e-learning system and take your project to new heights. 

Download | Demo | Web hosting

3. UpDraftPlus

Also with more 500.000 active installations and an overall rating of 4,9 stars, UpDraftPlus is another popular migration plugin for WordPress websites. Like Duplicator, this plugin has already been part of our recommendations for quite a while. The free version is available in the directory of WordPress plugins.org, but there is a The premium version available for between $ 70 and 145 $.Updraftplus plugin wordpress migration clone backup

UpDraftPlus, while free, is a powerful plugin that supports default cloud storage, automatic scheduled backups, and the latter splits compressed files into multiple parts when the website is very large. Creating a backup is all about choosing which files and directories you want to include in it. You can then restore a backup to an existing website; replace themes, plugins, add files and all with just one click.

Read also : 7 WordPress plugins to combat spam

The premium version offers many more features, with additional storage locations, database encryption, compatibility with multisite, premium customer support and multiple operating licenses.

The Premium version also offers a tool that allows you to clone a website in one click and a migration feature that allows you to move a website.

Download | Demo | Web hosting

Recommended Resources

Find out about other recommended resources to help you build and manage your website.

Conclusion

That is all ! We hope this article helps you allow users to filter posts and pages. Do not hesitate to share with your friends on your favorite social networks

However, you will also be able to consult our resources, if you need more elements to carry out your projects of creation of Internet sites, by consulting our guide on the WordPress blog creation.

And if you have any suggestions or remarks, leave them in our section Comments.

...