How to Set Up Feed to Post's Extraction Rules

Extraction rules allow you to remove unwanted material from imported posts’ content. This is particularly useful to remove elements such as social network sharing buttons and adverts.

Each extraction rule is a CSS Selector, coupled with a removal type. The plugin will scan the post content when it is imported, and for each extraction rule, any matching elements are removed according to the removal type chosen.


Usage

To add an extraction rule, visit the Feed Source in question, scroll down to the Extraction Rules meta box, and click the Add new button. A new row should appear below any existing extraction rules you might have.

To remove an extraction rule, click the button with the trash icon to the right of the extraction rule. The row containing the extraction rule will then disappear.

Examples

Below is a screenshot of the option’s interface. Each extraction rule is presented as a text field and a drop-down menu, for the CSS Selector and the removal type respectively.

In the above examples:

  1. We are removing all <div> elements with the class share-btns.
  2. We are removing all <a> elements (links), but keeping their content.

    This allows us to remove the link elements, but keep the text, which results in unlinking the text.

  3. We are removing all elements that are not <div> elements with the class content.

    This allows you to remove everything else and only keep the matched elements and their contents.


Supported Selectors

Feed to Post uses the Ganon PHP library to make the extraction rules possible, and thus supports all selectors provided by Ganon. View the full list of supported CSS selectors here. View the list of selectors specific to Ganon here.


Finding a CSS Selector

If you’re not sure how to locate the CSS selector for that particular part of the post that you’re looking to have removed from your site, you can follow the instructions in the post below. This will guide you to finding the extraction rules you need.

If you cannot find one that is unique to the item/text you want to be removed, it might not be possible to use an extraction rule for that item. If you’d like to confirm this you can contact our support team for more details.

For a comprehensive CSS cheat sheet, you can visit this page.


Disclaimer

We are committed to providing flexible and powerful importing solutions to help our customers get the results they need. 

However, it is the responsibility of the customer to understand how these rules work. While we will answer any questions with regard to the usage of Extraction Rules, we are not responsible for providing rules for each individual case.

Still need help? Contact Us Contact Us