Created
February 26, 2026 08:15
-
-
Save pirate-bot/e0359d3752156d75392ba0d273e40af5 to your computer and use it in GitHub Desktop.
Remove duplicate feed items via titles.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| Plugin Name: Feedzy tweak - Remove duplicate feed items via titles | |
| Description: When you have a large set of feed URLs that you would like to display. Use this plugin to remove the duplicates based on their titles. | |
| Version: 0.0.1 | |
| Author URI: https://themeisle.com | |
| */ | |
| function tifd_feedzy_remove_duplicates( $items, $feedURL ) { | |
| $uniques = array(); | |
| foreach ( $items as $item ) { | |
| if ( isset( $uniques[ strval( md5( $item->get_title() ) ) ] ) ) { | |
| continue; | |
| } | |
| $uniques[ md5( $item->get_title() ) ] = $item; | |
| } | |
| return array_values( $uniques ); | |
| } | |
| add_filter( 'feedzy_feed_items', 'tifd_feedzy_remove_duplicates', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment