WPSolr logo
Close this search box.

Wordpress PHP guides for WordPress & WooCommerce

WP_Query Wordpress search

How WP_Query performs a WordPress search

WordPress relies on the WP_Query class to perform searches (and load data in general). This class is a very versatile and customizable piece of PHP code since it includes many WordPress hooks and this way many plugins have been built around it. Without WP_Query, adding an efficient and relevant WordPress search would be very difficult.   This guide will overview the components of the WP_Query class, among others, that form the search functionalities within WordPress.     For the purpose of this guide, let’s consider that the user enters the term “shirt” in the WordPress search bar.     This will reload the page. It will now have the following url : https://www.yourwebsite.com/?s=shirt.   This way the term you want to search (in this case