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 advertisements.

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.

To add an extraction rule, 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 can icon to the right of the extraction rule. The row containing the extraction rule will then disappear.

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.

wpra-feed-to-post-extraction-rules-new

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.

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

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.

An Intro to CSS: Finding CSS Selectors

 

If you cannot find one that is unique to the item/text you want 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.

We are committed to providing flexible and powerful importing solutions to help our customers get the result 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.