Can I disable the autocomplete when using the Swiftype WordPress plugin?


#1

I love the search results that Swiftype provides, but I don’t want the autocomplete dropdown. Can I disable it?

Yes, this is possible with recent versions of the Swiftype Search WordPress plugin. First, ensure you are running the latest version of the plugin. Next, add the following to your theme’s functions.php:

function swiftype_javascript_config() {
?>
<script type="text/javascript">
var swiftypeConfig = {
  disableAutocomplete: true
};
</script>
<?php
}

add_action('wp_head', 'swiftype_javascript_config');

Your WordPress theme must support the wp_head function for this to work (most do).

For more details, see the Customizing autocomplete results section of our WordPress tutorial.