How to modify the search results query in WordPress

Prem Tiwari - - WordPress Snippets


If you are using custom post type in your WordPress site to share your content with your users like Movies, Deals, discount, and etc., then keep your close attention in this post as I am going to share how to modify the search results query in WordPress.

How to modify the search results query in WordPress

You can modify the query which fetches the search results during the Loop on the frontend site using the pre_get_posts hook.


About: Prem Tiwari

Prem Tiwari is the founder of FreeWebMentor.com and also a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies.