# Can I make the Swiftype WordPress plugin search only posts?

**URL:** <https://community.swiftype.com/t/can-i-make-the-swiftype-wordpress-plugin-search-only-posts/32>\
**Category:** WordPress\
**Created:** [December 21, 2015, 5:21pm UTC](https://community.swiftype.com/t/can-i-make-the-swiftype-wordpress-plugin-search-only-posts/32 "2015-12-21T17:21:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/swiftype/original/1X/fd652d1735c60057fa71c371375511028f9a1832.png) [@system](https://community.swiftype.com/u/system)\
**Post date:** [December 21, 2015, 5:21pm UTC](https://community.swiftype.com/t/can-i-make-the-swiftype-wordpress-plugin-search-only-posts/32/1 "2015-12-21T17:21:44Z")

</div>

Yes, the Swiftype WordPress plugin supports filters that allow you to customize what is returned with search results.

To search only the “post” type, add this filter to your **`functions.php`** :

```auto
function swiftype_search_params_filter( $params ) {
    // set the types to allow
    $params['filters[posts][object_type]'] = array( 'post' );

    return $params;
}

add_filter( 'swiftype_search_params', 'swiftype_search_params_filter', 8, 1 );

```

To limit autocomplete results to only the “post” type, add this action to change the autocomplete JavaScript configuration to your **`functions.php`** (take care to change the\*\*\<?php ... ?\>\*\* nesting as appropriate for your **`functions.php`** file):

```auto
function swiftype_javascript_config() {
?>
<script type="text/javascript">
var swiftypeConfig = {
  filters: {
    posts: {
      object_type: ["post"]
    }
  }
};
</script>
<?php
}

add_action('wp_head', 'swiftype_javascript_config');

```

Note that this requires your theme to have a **`wp_head`** function call. Most themes do, but if not you can add the JavaScript code directly to your template in the **`<head></head>`** section.

For more details, read our [WordPress search result customization tutorial](https://swiftype.com/documentation/tutorials/customizing_wordpress_search).

**NOTE:** It is recommended to install your theme customizations into a [child theme](http://codex.wordpress.org/Child_Themes) so that your changes are not overwritten on theme upgrades.
