Tricks and tips for everyone


How do I search for a title only in WordPress?

How do I search for a title only in WordPress?

While there’s probably a plugin for this, we have created a quick code snippet that you can use to limit search to post titles only in WordPress. add_filter( ‘posts_search’ , ‘__search_by_title_only’ , 500, 2 );

How do I exclude posts from search results in WordPress?

To Exclude a Post From WordPress Search Results Go to your list of posts and Click the “Edit” link for the post you would like to exclude. Scroll down to the bottom right of the post. Check the box for “Exclude from Search Results.”

How do I search widgets in WordPress?

All you need is to head towards the WordPress widgets.

  1. Go to your Admin Dashboard.
  2. Navigate to Appearance > Widgets. Here, you’ll find the widget named Search under the Available Widgets.
  3. Click on it and then hit the Add Widget button.
  4. Now go to your site and you’ll see the Search widget on the sidebar.

How do I restrict search in WordPress?

How to Limit Your WordPress Search Results

  1. Using A Hidden Input Field In Your Searchform. php. This is the method I currently use on so when people search the main site they will only get search results from the “WordPress Themes” category.
  2. Adding A Query Statement To Your Search. php File.

How do I use Relevanssi in WordPress?

How to Improve the WordPress Search with Relevanssi. To do so, log into your site’s admin area ( and then navigate to Plugins > Add New using the sidebar menu. From the Add Plugins screen, enter ‘Relevanssi’ in the search field and then install the first item listed in the results.

How do I exclude a search?

You can exclude a word from your search by putting a minus sign (“-“) immediately in front of the term you want to exclude. Make sure you include a space before the minus sign. For example, the search: will return pages about bass that do not contain the word “music.”

Related Posts