Media: Post Parent Attribution

Last updated December 18, 2018 « Knowledge Base

By default, Media results are returned just like any other post type. The result (also like other post types) will use the Media title, Caption, and other data to show the entry within the results template.

There are times when instead you would prefer not to have the Media result itself returned, but instead for that Media content to “count” towards the parent post. Enabling SearchWP’s post parent attribution does just that.

Take for example this Page that includes a PDF download to a spec sheet:

Screen Shot 2016-06-06 at 2.17.11 PM

The PDF itself has valuable content that should be included in search results, but instead of linking to both the PDF and this Page in the results, we can tell SearchWP to attribute all of the PDF content to the parent Page instead.

Transfer search weight to parent

With this setting enabled, searching for any content in the PDF will not increase the weight of the PDF itself, but instead attribute all of that keyword weight to the parent Page.

For example: a search term that is present in the PDF (but not the parent Page) is “boxer”. Without Attribute post parent enabled, we see that the result is the PDF itself:

Screen Shot 2016-06-06 at 2.26.12 PM

When we enable Attribute post parent, that same search will return the parent Page instead, which in this case is much more useful:

Screen Shot 2016-06-06 at 2.28.06 PM

NOTE: When enabling parent attribution, the parent post type MUST be enabled in order for the result to be returned.

Determining the post parent

By default, any Media uploaded when editing any post will define that post as the Media parent. You can check to see which post is the parent by viewing the entry for the file in the Media library:

2016-06-06 at 2.33 PM

If using Grid view, click the icon for the file and review the Uploaded To link in the modal sidebar:

2016-06-06 at 2.35 PM

Fix Search on Your Site. No Coding Required!

Now you can utilize all of the content that's gone unrecognized by native WordPress search instantly with SearchWP

Get SearchWP