# How do I include featured images in my WordPress based engine?

**URL:** <https://community.swiftype.com/t/how-do-i-include-featured-images-in-my-wordpress-based-engine/103>\
**Category:** WordPress\
**Created:** [December 22, 2015, 5:37pm UTC](https://community.swiftype.com/t/how-do-i-include-featured-images-in-my-wordpress-based-engine/103 "2015-12-22T17:37:05Z")\
**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 22, 2015, 5:37pm UTC](https://community.swiftype.com/t/how-do-i-include-featured-images-in-my-wordpress-based-engine/103/1 "2015-12-22T17:37:05Z")

</div>

> **The posts and pages in my WordPress site have featured images set, but those image links don’t appear to be included in my results indexed with the Swiftype WordPress plug-in. How do I fix this?**

To include featured image links with your WordPress search engine results, you’ll need to add a custom function to your theme’s **`functions.php`** file.

Here’s an example function that will use the featured image of the post as the **`image`** field value in Swiftype:

```auto
function update_swiftype_document_url($document, $post) {
    $image = wp_get_attachment_image_src(get_post_thumbnail_id($post - > ID), 'thumbnail');
    $document['fields'][] = array('name' => 'image',
        'type' => 'enum',
        'value' => $image[0]);

    return $document;
}

add_filter('swiftype_document_builder', 'update_swiftype_document_url', 10, 2);

```

This function should work in most cases, but might need to be modified depending on how you’ve customized your WordPress theme.

You can find additional information in our [Customizing Wordpress Tutorials](https://swiftype.com/documentation/tutorials/customizing_wordpress_search) documentation.
