Tag Archives: Improvement

Disable default WordPress search query


If you’re going to implement your custom wordpress search (not wordpress native) on search.php template – for example using Google Custom Search or Bing – you might have everything working ok, but wordpress is still performing search queries to database which can slow down your site. This is because wordpress treats search.php template as search page, no matter what is inside and prepares post list before it’s loaded.

So to avoid this, you need to use the following code:

Improving WordPress .htaccess – optimize WP’s 404 response

wordpress_404_page

WordPress has a 404.php template that’s generated for not found posts/pages. That’s fine, but what happens if post contains an image that’s deleted or moved from your blog or just path is set incorrect? It will output this 404.php template to the browser that’s actually doubles the traffic for a single page (for every not found object it will multiply traffic/load for every page)! Also, some bot’s request some strange urls never existed on your site that also slows down the server. To fix that I recommend to add elegant rules to WP’s .htaccess file: