Feedwordpress Advanced Filters

Feedwordpress Advanced Filters is a plugin for Feedwordpress which allows you to easily filter and manipulate content from your feeds.

feedwordpress_advanced_filters_screen_05

Features

  • Remove certain keywords from your feed posts
  • Remove HTML tags from your feed posts
  • Store feed images locally and resize them to your needs
  • Associate posts to different categories based on keywords
  • Apply filters on all your feeds, select different filters per feed or combine both

Installation

Feedwordpress Advanced Filters requires Feedwordpress to run. Make sure Feedwordpress is installed and running before attempting to install FAF.

To install simply copy extract the ZIP file and extract the directory to your wp-plugins/ folder.

Getting started

After activating the plugin there will be a new tab on both the ‘posts & links’ as on the ‘categories & tabs’ page called ‘ Feedwordpress Advanced Filters’. You can add filters and select the desired options.

‘Filter process settings’ define the order in which filters are executed. You can choose to only execute the filters defined for all feeds, only the per feed filters ( this allows you to disregard the global filters and thus make exceptions for certains feeds ) or you can choose to either the execute all feed filters first or after the per feed filters.

Example

You might want to filter unwanted HTML from feeds but completely kill it in one feed. You can define a HTML filter for all feeds filtering just a part of the HTML. For the one feed you want everything gone, you simply add a HTML filter on that specific feed. Using the process settings filters can complement each other doing ‘part of the job’.  Also take care, since this way your settings for all feeds might interfere with filters defined on the feed itself ( or the other way around ).

Requests and Support

Feedwordpress Advanced Filters is still in development. This means that new features will be added as well as bugs may (and will) happen. You are strongly encouraged to test FAF first on a test server before installing this plugin on a production environment!

Request for additional features are welcome, although I can’t guarantee anything.

In case of bug, problem, idea etc feel free to contact me or drop a note in the comments here and I’ll get back to you.

Download

Latest version

Like it?

77 comments

  1. Fatal error: Call to undefined method DirectoryIterator::getExtension() in /nas/wp/www/cluster-1307/lasivon/wp-content/plugins/faf/feedwordpress_advanced_filters.php on line 81

    • Could you check the PHP version of your webserver? It should be at least PHP 5.3 ? I’m marking this as a bug though since it is easy to find a work-around for slightly older version.

  2. Hey Bas, great plugin. I made a small tweak that may be useful to others, wanted to share it with you. I needed to have feedwordpress set a featured image automatically for each new post in the feed. So I used your plugin and added this line to image_filters.php in the function “process_complete” at about line 76. It’s quick and dirty, and simply sets the first image as the featured image.


    if (!empty($post_id) && !has_post_thumbnail($post_id)){
    set_post_thumbnail($post_id, $attach_id);
    }

    In googling for solutions to the problem, I saw quite a few developers looking for a solution to this problem, so this may be something that could be developed into a useful feature.

    Cheers,
    Mark

    p.s. This is how the code looks in context, starting from line 59.


    // post process to fix attachments to posts
    public static function process_complete()
    {
    global $wpdb;
    $sql = "SELECT * from $wpdb->postmeta where meta_key = 'faf_process_image'";
    $q = $wpdb->get_results($sql, ARRAY_A);
    foreach($q as $process )
    {
    $values = explode(",",$process["meta_value"]);
    $post_id = $process["post_id"];

    foreach($values as $attach_id)
    {
    $postAr = array();
    $postAr["ID"] = $attach_id;
    $postAr["post_parent"] = $post_id;
    wp_update_post($postAr);
    if (!empty($post_id) && !has_post_thumbnail($post_id)){
    set_post_thumbnail($post_id, $attach_id);
    }
    }

    }
    $sql = "DELETE from $wpdb->postmeta where meta_key = 'faf_process_image'";
    $wpdb->query($sql);

    }

    • There is another way to take care of this, use this plugin: WP Facebook Open Graph protocol. I found it while trying to figure out why when I share a link to facebook it would not post the image from my wordpress post.

  3. Hi Mark!

    Cool to see that people are thinking of interesting ways to use the plugin. I think it could be very interesting, but still I’m fixing a problem when a every post has multiple images. I’m putting it on my list as a future feature. Let me know if you think of other cool things :)

  4. faf 0.5.8 on installation:
    Fatal error: Call to a member function getFilename() on a non-object in /var/www/clients/client11/web94/web/wp-content/plugins/faf/feedwordpress_advanced_filters.php on line 89
    ~ # php -v
    PHP 5.3.3-7+squeeze15 with Suhosin-Patch (cli) (built: Mar 4 2013 13:11:17)
    Copyright (c) 1997-2009 The PHP Group
    Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH

  5. Have an older version of PHP installed (5.2.17) – remote hosting, not much I can do about it.

    Is there a work around for this when trying to activate the plugin?

    Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in /home/content/x/x/x/xxxxxx/html/twistinfo/wp-content/plugins/faf/feedwordpress_advanced_filters.php on line 167

    Thank you very much for the help!

  6. Getting this when I try to activate your plug in

    Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in /home3/joslynsc/public_html/gadgu/wp-content/plugins/faf/feedwordpress_advanced_filters.php on line 155

    Running PHP 5.4 – also running with Headway Theme. Not sure if that has anything to do with it. Any help is greatly appreciated.

    Thank you.

    • It appears the PHP upgrade I did applied didn’t get applied properly to sub-directories. As a result, my site is still running PHP 5.2.x. Hopefully once I get this resolved, the problem with the plug-in will also be resolved.

      Thanks again.

  7. Dear Bas,

    thanks for the nice plugin, but I have some issue I don’t really understand and perhaps you could help me out with it.

    Is there a size limitation for images to be imported?

    I have a custom made rss feed with non-standard rss fields, but also with standard fields.

    For testing I added a image URL to the following tags:

    <![CDATA[<img src="….
    <enclosure type="image/jpeg" url="….

    But for some reason FAF imports only 1 image, the one thats under "<![CDATA[<img src="…." and only if its in thumbnailsize like 90×90 pixel. The other sized images like 150×200 pixels he ignore for import.

    My filter is setup to:
    - Filter processing settings : Only excute filters for all feeds (ignore per feed settings
    - Save images locally
    - do not resize
    - Set featured image

    The rest is unchecked.

    What can I do to get him to import full sized images from other fields like and with higher resolutions?

    Thank you very much for your help.

    Best regards!

    • Hi Florian,

      There is no limit to images other than the server / WordPress puts so that shouldn’t be a problem. With Do Not Resize set it also should leave the size completely alone.

      I would like to test this specific case, can you link to the feed you are trying to use? ( Or put it somewhere ).

      • Dear Bas,
        thank you for your suggestion…I fixed it, and it was as you mentioned a problem with my source server which generates the rss feed: the firewall resolves external urls of images in other IP/URL as to the public….I now tunnel all traffic for the RSS Feed and your plugin works like a charm! Thank you for that! :)

        Only one thing yould improve: for me, image import only works with “in Text” images and/or images in the “” tag. But not for images in a traditional “” tag. perhaps you will add this in the feature….or it is still in it and it just doesn’t worked with my feed :)

        But doesen’t matter because everything is fine and working now with the right firewall settings and using the “” tag! :)

        Keep up the good work and thank you for your time/support.

        Best regards!

        • i mean “enclosure” tag is working and “image” tag is not working :) ….seems the comment system strips away text inside the tags :)

  8. [...] Feedwordpress Advanced Filters – The first time I used this i=one, it adds some post processing to syndicated feeds. I used it here to have the site make local copies of any images in feeds, so we don’t end up later with missing image links [...]

  9. […] we do lose any locally uploaded images in the source blog. One way we could address this is the Feed WordPress Advanced Filters Plugin. This makes a local copy of any image in a feed, so we would not lose the media when the blog goes […]

  10. I’m using feedwordpress with a facebook feed. It’s pulling everything fine, but it seems to print out HTML codes instead of characters, but only sometimes. I am running php 5.3.

    For example, instead of quotation marks (“), it will print out "
    Instead of the ampersand (&) it prints out &

    I haven’t seen it happen with any other characters (so far). I had hoped this filter plugin would offer a way to do some sort of replace function but it doesn’t. Any ideas on how I can fix this? Is this a common issue? It happens in both the titles and the content.

  11. Hi!

    Im searching solution for my problem. How could I do the following settings in STEP2?
    STEP1.: Im useing one category to syndicated post from one feed. The name of my category is REGIONAL NEWS. //I HAVE DONE IT//

    STEP2.: I would like to setting up some keywords in filter. The syndicated post which is included one of my keywords, will automatically placed under the CATEGORY2, and this post doesent placeing under REGIONAL NEWS.

    How could I do the step2?

    Thank you for your help! :)

    • Hum that is I think not possible. You can add an -extra- category to a post using the category filter but not replace a category by another.

      You can fix this though in your category logic. Just exclude the category 2 posts from your normale category stream ( get_posts -cat, see WP docs)

  12. Hi Bas,

    I installed v0.6 on FWP 2013.0504 on WP 3.6.1 on PHP 5.4 … installation run without any problem, the “advanced filters overview” menu was added to syndication’s menu … but the frame with the advanced filters options is empty.

    Only “Feedwordpress Advanced Filters Overview
    This page will display the filters from all feeds in the order they will be executed on the posts” and the link to this page ….

    What went wrong?

    Regards,
    Stefan

    • Quite possibly nothing. The overview is meant to see all you -current- filters, not to add new ones. Go to the section ‘ posts and links ‘ for instance and you’ll see a tab ‘FeedWordPress Advanced Filters’ and in there a block ‘ new filter’ . Here you can add filters for all your feeds or settings per feed (select a feed first, just like in FWP ).

      Let me know if that helps!

  13. Hi Bas,

    Great plugin. I’m having one problem, I know it has been noted a few places, but I do not seem to be getting anywhere with the problem. Only some of the images that are stored locally show up or are imported correctly. The following is the website – http://cbssports.newstalk.fm/ . Here is the feed I’m trying to import – Sports Feed: http://abcnewsradioonline.com/sports-news/rss.xml

    Any help would be so greatly appreciated.
    Thank you.
    Steve

    • I have looked at the feed briefly, but from what I can think of it might be caused either by the querystring ( the stuf after jpg?jsksjfksd blabla ) or because some images have spaces in them ( or %20 ) . I have no time this week but maybe I can look at it this weekend if something goes wrong in the filters. But you can also dig yourself to see if you see any patterns in when the images go wrong.

      ( On another note: there is loads of HTML in that feed, are you using the HTML-filter also? It might also go wrong on that level )

  14. Hi,

    I tried today FAF and when I want to store images locally I get this error. Can someone help me?

    Regards,
    Robert

    Warning: fopen(/(…)/reclaim/wp-content/uploads/2013/10/bilderrahmen-werkstatt-wien.jpg) [function.fopen]: failed to open stream: No such file or directory in /(…)/reclaim/wp-content/plugins/faf/filters/image_filters.php on line 38

  15. Considering that WordPress itself only requires PHP version 5.2, it’s really not great that this plugin requires v5.3

  16. Can anyone tell me where these filters are stored? are they stored in mysql? locally in a file? I can’t find where these are stored. The only thing I have been able to come up with is that it is stored off site somewhere else.

    I am trying to figure out how I can create multiple filters in bulk much easier than one at a time.

    • Nevermind I found it in the wp-options table w00t :)

      • Nice. I was just about to post that

        • I have all of it figured out except that in the begining of the option_value field there is this “a:2:{s:10:”categories”;s:5806:”a:17:”

          the number 5806 changes as you add more filters and even changes when you add categories. Not sure how it relates or how to come up with that number

          I did figure out that the “s:xx” before the filter name is the character count of the filter you choose. So if I add a new filter and want to find the word “Test” then the “s:xx” would be “s:4″ you have to include spaces as well.

          Also in the beginning of each new line there is a “i:x” which is the filter number which starts at “i:0″ and goes up incrementally from there.

          I am going to blog about this on my blog as soon as I figure it out at http://www.ihatequickquestions.com so check it out there.

          • Ok I figured it out, it has to do with the character count of the whole script between some particular quotes. I will blog about this tomorrow and show you how to do it

          • I’m curious if you did anything with this already? :)

          • I did, I have the script if you want. Its pretty slick. So it will create a filter for each category you have and associate it with that category all in one shot :)

            What I did to get all the categories was 2 things. First through syndication I get categories automatically and I did keyword research and got all the keywords I want to use and made categories with those using a bulk category plugin. I think its called “WPEssence Bulk Categories” http://wordpress.org/plugins/wpessence-bulk-categories/

          • Of course I’m interested. Being able to be more bulky with FeedWordPress is one of the things I’m hoping to improve over time with the plugin :)

          • oh you are the developer..lol yeah man hit me up with my email I have listed with these comments. If you dont have it then maybe I can tweet it to you.

  17. Hi,

    Thanks for the plugin, it’s geat! I just have one problem and have tried all options. I’m trying to take a feed from http://www.volcanic.co.uk/ruby-on-rails/

    Everything works well except the images do not appear inside the posts. They work fine for the thumbs and showing excerpts but not within posts. Something you could help me understand please?

    Thanks,

    Lyndon

    • Sorry for the late response but I was terribly busy.

      First of all verify if the images are actually being saved locally. You can see this for instance in the media library. There should be images and those should be connected to posts. If not, then something is wrong with importing the images.

      If everything is fine then search in your theme how images are being used there.

  18. Can you please suggest on the following error

    Invalid argument supplied for foreach()

    in /var/www/content/wp-includes/functions.php on line 1834

    • That’s a WordPress function failing somehow. Ways to fix :

      - Check what’s on that line (function name)
      - Does this happen with FAF (you still have this error with the plugin off? )
      - If it is FAF please post:
      – WordPress version number
      – Which filters you are using
      – For which RSS-feed this error comes up

  19. When I originally left a comment I appear
    to have clicked on the -Notify me when new comments are added- checkbox and from now on every time a comment is added
    I receive 4 emails with the same comment. Is there a means you are
    able to remove me from that service? Thanks
    a lot!

  20. Feature suggestion, I need a find/replace function that works for multiple words or word strings and links. I have 2 links in the feed I’m using I would like to re-word or rename. Please consider adding this to future versions. Thanks

  21. Hi Bas-
    Great idea for a plugin, but I’m not able to get it to strip out HTML from the RSS feeds we are using. They pile a bunch of image and link tags into the description, which makes a mess out of excerpts, etc. I have the plugin set to remove HTML from Excerpts and Content, but I see no changes in how posts actually come into the system. Also no errors, however. Newest version of FWP and your plugin, running on WP 3.5.2. Any suggestions?

    • I can’t tell you like this. Maybe you can make a screenshot of your settings and post the feed you are using? Then I can test some day when the dark being of deadlines is not looming over me.

  22. Hi Bas-
    Thanks for looking into this. Here’s the feed in question: http://feeds.feedburner.com/entrepreneur/franchises
    (we are actually using 4 from Entrepreneur, but this one is representative of their format)

    Here’s a screenshot (url) of our settings for this one feed. There are NO filters set for ALL feeds: http://www.strategybg.com/wp-content/uploads/2013/10/Screen-shot-2013-10-24-at-9.11.39-AM.png

    I’ve tried every variation in settings I can think of, and tried a custom HTML filter written by Charles Johnson too. No luck. Let me know your thoughts.

    • Ah yes, that’s another fun variation. The feed actually doesn’t has any HTML in it, but only escaped codes. It looks like for some reason these are later converted back to HTML in WordPress, probably when inserting it as a post. This will go on the known issues list for next release.

  23. Hi Bas-
    So are you saying that FAF doesn’t have any way to filter out this stuff? Any advice on a custom filter? I realize it’s a total nightmare for you with all the wonky ways people implement their rss feeds these days….

    • Every day another RSS feed format indeed :) . I put it on my todo list to see if I can build something like this into the system.

      For now I don’t really have any advice unless you can program yourself. Then you could for instance just build a custom filter upon FAF which handles this via a regular expression or so.

  24. How do I add separate my keywords in one filter. I need to remove ascii code characters from my feed.
    ie:


    >

    Do i need to create a filter for each or can I separate them with a comma
    ie:
    “, ’, >

    Thanks

  25. Hi,

    I am developing a multisite network for a client and am using Feedwordpress to syndicate content from the main site into all the sub sites which is working well. The only issue i have is that some of the posts on the main sites, have a native wordpress gallery in them and when the post is syndicated and republished to a sub site, the gallery code around the images is stripped out and the links are changed. Is there any way to fix this using advanced filters?

    Thanks
    Daniel

    • I honestly have no clue. Are you already using FAF and if so which filters do you use? Without using FAF does the gallery get ripped out as well? If so then I think it’s a problem with WP-kses and related filters ( you can unset those filters in functions.php if needed ). FAF mostly gets rid of stuff not preserve them ;) Posts will go through FeedWordpress -> FAF -> WordPress routines where WP filters the most I think. You might want to research there.

      • Hi Bas,

        Thanks for reply. I’m currently using Feedwordpress only (and the galleries get stripped out) and installed FAF to see if there was a way to preserve the gallery, but seems I’ll have to dig a bit deeper.

        Thanks

  26. Hello Bas,

    Nice plugin.
    I have a problem.. I set a filter with more than 10 keywords. If keyword matches the posts will go to a category what I set. (the category name is “DELETED POST”)

    It was worked with 5-6keywords, but now with 10 keywords the all post is added to the Deleted post!

    I’v checked it, and the posts does not include words from keywords list.

    • I’ll have to look at that some day ( I’m writing it down ) . Maybe a temporary solution is to split the filters into two filters? Maybe there is a keyword truncated and started to match everything?

  27. Hi, i have a problem with Set featured image, dont appear any image on posts, just text. Here is the image of the options put on.

    https://drive.google.com/file/d/0B9MXH40wJRkGbFdQWmk2U2ZGUms/edit?usp=sharing

  28. Ok, now i understand, i need to insert the image on the post not just featured images. Thanks a lot

  29. Any ideas how to speed up a site using feedwordpress? I run several on a VPS and its kills my performance. I recently went from Godaddy to Bluehost because Godaddy kicked me of their servers lol. Anyways I run several sites using feedwordpress and its killing my VPS which has 4 gigs of Memory. I have no idea what to do except upgrade but that is not a long term solution. Any tips to speed things up within the plugin?

    • Check if FWP re-indexes often or not. I don’t know how many sites you are indexing, but I can imagine if you check every minute a long list of sites the hoster might not be happy. Try to check sites only once in a while . Most sites don’t have new content every 5 minutes anyway.

  30. Is there a way to make the plugin go back and download all the images in posts previously syndicated? I’d like to fix up the old posts as well as have the new ones work properly from the get go.

    • Sorry but no. FAF relies on whatever comes by FeedWordPress . One thing you could though is export your old posts as RSS and the re-importing them into the blog. But I certainly would test that and make backups before trying.

  31. Having issues now where FWP will not import any images at all. None in Uploads dir, none in Media Library. No matter how settings are, it seems to leave the img src pointing to the original source. I’ve tried with and without FAF managing image imports. Have you seen this before? Was working until Dec 15th.

    • Did you check uploading normally, file permissions, .htaccess etc? Gd library extension?

      If everything working then check the feed. A lot of weird characters, spaces or the use of unknown file extensions something interfere with the recognition of images in the plugin.

  32. Please please tell me how I can eliminate the “excerpt” in post I receive via RSS through FeedWordPress. I have FeedWordpress Advanced Filters installed.
    Thanks
    Lee

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>