How do I speed up by Woocommerce Search Plugin?

How do I speed up by Woocommerce Search Plugin?

The best way to speed up your WooCommerce Search Plugin is to remove as many non-relevant products from the CMS as possible however, if you have done this then you you can also tweak the settings of the search plugin to achieve a slightly faster result.

In this article I will show you how to tweak the settings for two of the more popular WooCommerce Search Plugins being Advanced WooSearch PRO and WooCommerce YITH Ajax Search (PRO).

Quick Links

Optimizing “Advanced Woo Search (PRO)”

Advanced Woo Search Pro is one of the more popular Product Search Plugins if you are using Woocommerce and allows you to place AJAX Powered search forms in various parts of your site via a WordPress Shortcode. For example in the menu Bar or indeed in the page content itself.

A search for ‘pots’ in Advanced Woo Search PRO producing real time search results from its search form.

It can however, become slow to produce results one a customer has begun to type with default settings enabled. In a recent project here is what I did in order to optimize its ability to show the results more quickly. Here’s what you can do in your own site…

  • Find the AWS options page in your WordPress CMS at a URL similar to this… https://yoursite.com/wp-admin/admin.php?page=aws-options
  • Go to the ‘Performance’ Tab
The Performance Tab in WP CMS

There you will see come configuration options where you can make some adjustments to help the load time of your Advanced Woo Search Plugin. We’ll go through them below.

Adjust the ‘Search Rule’

You can ask AWS to search the products with the users search term in a ‘contains’ or a ‘begins with’ basis. The later is faster. You can simply select it and hit ‘Save Changes’ in on the AWS settings page to make this easy switch.

Adjusting the ‘Search Rule’ Setting in AWS Settings page

Turn on the Cache option:

Caching the results means a fresh search does not need to be performed every time someone searches and hence means that the results can be returned to the user more quickly.

All you need to do is make sure ‘On’ setting is turned on and you save the settings after making your selection.

Turn on the cache setting to speed up search results in AWS

Index only relevant info about your products:

AWS indexes certain pieces of information about each product but not all of this will be relevant to what your user, who is typing in the search form, wants to search for.

For example, in one of my recent projects the ‘Product ID’, ‘Taxonomies’ (categories, tags etc), ‘Attributes’ and ‘Custom Meta’ were not likely to be relevant to what the user was typing in the form so we could remove these from the index meaning that the search does not need to match against as much data before providing a result.

Change the various info which is indexed on each product to reduce search time

More Index Settings:

There are two more index settings worthy of note.

Remove Index of product variations:

You can stop the index from containing ‘Product Variations’ (which are variations on one product for eg different sizes of shirts would be considered a variation)

Syncing Index Data:

If you turn off this setting then AWS will not update the Index Data everytime product data changes. In some sites product data might update regularly from API’s and hence trigger the index table to sync up frequently. You may want to turn this off in this case so the sync process doesn’t run all the time in the background.

Turning off ‘Index Variations and Index Table sync to speed up your search and site generally

Optimizing ‘WooCommerce YITH Ajax Search (PRO)’

YITH WooCommerce Ajax Search is another popular option in this space. It has less options to customize the speed of the search but you still have a few tweaks you can make. Most of these settings are only available in the PRO version but there is a free one also just with less options.

Minimum Chars for search:

On the ‘General Settings’ Page and available in the FREE version you can tell YITH to only search after the user has entered a certain number of minimum characters. For eg, only start the search after 4 chars. The effect of this is that a search will not start with the first 3 chars that the user enters and hence you will put perform once search instead of 4 (comparing to a minimum of 1 hypothetically ). This means you are lightening the load for the plugin and you’ll get a slightly faster search as less AJAX Requests are being sent.

Maximum Number of Results:

Also on the ‘General Settings’ and available in the FREE version if you set this to something low (default is 3) then you will also be putting less load on the plugin and hence slightly speed up the search results coming to the user. This is because YITH will stop searching after the maximum number is hit and return the results sooner compared to a maximum results being 10 or 20 for example.

General Settings Page where you can set minimum and maximum for chars and results.

Additional Features:

The PRO version of YITH allows additional features where you can allow and more importantly disallow particular search features which can reduce the speed of the results being returned.

Allow users to limit the search to All the site or just products:

Checking the box to allow limiting of the search to just products means your users have more control over the scope of the search and hence speed it up. For eg, searching just products will be quicker than searching both products and the rest of the site. Especially if the rest of your site is large.

Control Categories to Search through:

You can tell YITH to allow for users to be able to search by categories as well as which categories to allow users to search through.

I would suggest that this could be a double edged sword. If you allow categories to search from you should remove as many of them as you can from the users ability to search. This will allow them to only see relevant categories and hence speed up their ability to execute a search.

I would also suggest that you don’t enable it at all if you can avoid it. In the back end of the site you will increase the slowness of the search results coming back if you search by both products AND categories. Searching just products will be faster. This come at a trade off of not allowing your customer a more fine tuned search though so adjust this advice to your own site and situation.

Control Category Filters on the settings tab with the PRO version of YITH

Selecting which aspects of the content to search through:

YITH PRO also allows you to reduce the number of data for each product which will end up speeding up your searches speed.

Go to the ‘Search Settings’ Tab in the YITH Plugin in your CMS and remove as many options as you think possible without hurting your customers experience (ie not being able to search what they want accurately). The less the faster search you can achieve.

Remove as many aspects of each product to search through in order to speed up your search with YITH

Alter thumbnail in search Results:

You can also choose to show or not show the product image. Images are often much larger in size than just HTML so removing this feature could speed up your search signifcantly.

You can also change the size of the image returned. If you are going to show images at all then make sure to reduce as small as possible. Default is 50px which is pretty good.

Remove product variations:

Removing product variations from the search results means there will be less products to search through for the YITH Plugin. A product variation is a slight variation of the original product. For example, if the main product is a t-shirt then the variations would be the different sizes for sale like S, M, L, XL.

If you don’t remove these then all of the sizes will show up in the search results as well. Maybe you want this and maybe you don’t but you can remove these to help speed up the search also.

In YITH Settings you can control the thumbnail and product variations settings to reduce the search speed.

Learn to customize WooCommerce Fully with an online Udemy course

If you’d like to know more about how to customize WooCommerce completely check out these courses from Udemy which are low cost, online and have been completed by thousands of people.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *