I have a heavy site with over 200,000 articles
When searching in WordPress, this search looks for the desired word in the title, content, and excerpt
In this number of articles, the result of slow query is more than 50 seconds and slows down MariaDB
I want to write a filter to limit this query to only titles
I think this slow query will be fixed and the problem will be solved
Please help to write this filter or help if you know that the problem can be solved by another solution
Thank you
in the file
wp-includes/class-wp-query.php
2
Answers
Can you please try this code and let me know if it work’s.
You can use this one