By default, the WordPress search feature searches through the entire content of a website. However allowing users to search by post title only can improve the user experience, especially if you have a large number of posts with similar content.
With the Search Bar block from the Nexter Blocks, you can easily limit the search to post title or other parts of the posts in WordPress.
To check the complete feature overview documentation of the Nexter Blocks Navigation Menu block, click here.
Requirement – This block is a part of the Nexter Blocks, make sure it’s installed & activated to enjoy all its powers.
To do this, add the Search Bar block on the page or template and follow the steps –
1. Open the item under Search Bar and select Post from the Source section.
2. From the Select Post dropdown, select Posts.
Now, you should be able to see a dropdown beside the search bar.
Then make the necessary changes to Label, Placeholder and Show Count sections.
3. After that go to the Standard Search tab.
4. Click on the Generic Filters section and only keep Search in Title enabled and the rest disabled.
Now this will limit the search to post title only and it will not look into other parts of the post.
Note: In a similar way you can limit the search to different parts of posts only.