Customized WordPress Administration Filters

Originally published at:

This article will outline what you need to know about WordPress and its filtering mechanism available to you via your posts administration screen.

We will detail exactly what the WordPress filters are and the purpose they serve in displaying your post listings. From there we will learn how you can extend your post administration area – by creating new customized WordPress administration filters.

By the end you will be able to take what you have learned and apply it to your own projects, allowing you to provide additional information and functionality for your end users.

Filtering Posts

WordPress will output its default filter mechanisms to the posts administration screen. These filters allow you to display only certain posts that match set criteria. For example, you may want to display posts published within a set date period (as shown below).

Default WordPress Post Filtering

WordPress comes pre-configured with several filters that you can use on your posts administration screen. Additional filters may be added by certain themes and plugins and provide additional filters for you to use.

Overall these filters serve the same purpose of allowing you to narrow down your listing of posts based on a set of criteria, viewing only the posts that are relevant given your set criteria.

Adding Your Own Filters

While WordPress comes with its own great set of filters, often you may want to add your own to help your users (or yourself) in narrowing down posts on your administration screen.

You can add additional filters to your website via the use of two hooks

  • restrict_manage_posts
  • pre_get_posts

Continue reading this article on SitePoint

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.