Title: FeedWordPress Duplicate Post Filter
Author: Mark Allen
Published: <strong>2008 年 4 月 13 日</strong>
Last modified: 2012 年 3 月 2 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://s.w.org/plugins/geopattern-icon/feedwordpress-duplicate-post-filter.
svg)

# FeedWordPress Duplicate Post Filter

 作者：[Mark Allen](https://profiles.wordpress.org/mrallen1/)

[下载](https://downloads.wordpress.org/plugin/feedwordpress-duplicate-post-filter.1.5.zip)

 * [详情](https://cn.wordpress.org/plugins/feedwordpress-duplicate-post-filter/#description)
 * [评价](https://cn.wordpress.org/plugins/feedwordpress-duplicate-post-filter/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/feedwordpress-duplicate-post-filter/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/feedwordpress-duplicate-post-filter/#developers)

 [支持](https://wordpress.org/support/plugin/feedwordpress-duplicate-post-filter/)

## 描述

This is a filter for the FeedWordPress plugin. **If you don’t use FeedWordPress 
this plugin will not be useful to you.**

I wrote this filter after seeing the same post in my database 32 times. Maybe you’ve
had the same problem, and I hope this filter helps you solve it.

The filter works by hooking the “syndicated_post” action of FeedWordPress and the“
save_post” action in the core of WordPress.

For each potential post from a feed, the plugin attempts to find an identical SHA1
hash of the first 1024 non-whitespace characters (stripped of HTML tags) of the 
post content.
 If it finds a match the post is skipped. If not, the post is processed
and a hash is inserted into the post’s metadata. (Stored as key _dpf.)

**NOTE:** No filter is going to be 100% accurate. This filter will stop _most_ or
_some_ duplicates, but in all likelihood, will not stop _all_ of them.
 If you want
a filter that stops _all_ duplicates, this isn’t your solution. In my test installation
I had 5 posted duplicates out of 125 syndicated posts (4% false negative) out of
a corpus of about 300 duplicates. Most of those false negatives were due to slightly
different HTML markup in the post content itself. So my approach isn’t perfect, 
but it is “good enough” for me.

### Important Note

This filter can only check future syndication posts. Whatever duplicates are already
present in your WordPress installation you’ll have to remove/clean-up on your own.

### License

Copyright (C) 2012 by Mark R. Allen
 All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

 * Redistributions of source code must retain the above copyright notice, this list
   of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this
   list of conditions and the following disclaimer in the documentation and/or other
   materials provided with the distribution.
 * Neither the name of Mark Allen nor the names of any contributors may be used 
   to endorse or promote products derived from this software without specific prior
   written permission.

## 安装

 1. Download the plugin and uncompress it.
 2. Plop it in the same directory as feedwordpress.php
 3. Enable this filter in WordPress by visiting the “Plugin” menu and activating it.

## 评价

此插件暂无评价。

## 贡献者及开发者

「FeedWordPress Duplicate Post Filter」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Mark Allen ](https://profiles.wordpress.org/mrallen1/)

[帮助将「FeedWordPress Duplicate Post Filter」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/feedwordpress-duplicate-post-filter)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/feedwordpress-duplicate-post-filter/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/feedwordpress-duplicate-post-filter/)，
或通过[RSS](https://plugins.trac.wordpress.org/log/feedwordpress-duplicate-post-filter/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/feedwordpress-duplicate-post-filter/)。

## 更新日志

1.5 – Remove HTML tags before computing hash.

1.4 – Overhauled strategy for duplicate detection. This works better than previous
strategies.

1.3 – Fixed a dumb typo. Rewrote the DB query using better wpdb methods (prepare
and query). Changed from htmlescape2 to esc_html WP function.

1.2 – Escaping the single quote (‘) character sometimes gives a conversion of ’ 
instead of ’ This caused a false negative and duplicate posts would be stored. Consider
this release a temporary hack until I write a proper regex based title escape function.

1.1 – Characters in post-titles like ‘&’ were not getting converted to HTML entities.
This caused the post title comparison to register a false negative. (So duplicate
posts would be added to your feed.)

1.0 – initial release

## 额外信息

 *  版本 **1.5**
 *  最后更新：**14 年前**
 *  活跃安装数量 **200+**
 *  WordPress 版本 ** 2.8 或更高版本 **
 *  已测试的最高版本为 **3.3.2**
 *  语言
 * [English (US)](https://wordpress.org/plugins/feedwordpress-duplicate-post-filter/)
 * 标签
 * [duplicate posts](https://cn.wordpress.org/plugins/tags/duplicate-posts/)[feedwordpress](https://cn.wordpress.org/plugins/tags/feedwordpress/)
 *  [高级视图](https://cn.wordpress.org/plugins/feedwordpress-duplicate-post-filter/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/feedwordpress-duplicate-post-filter/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/feedwordpress-duplicate-post-filter/reviews/)

## 贡献者

 *   [ Mark Allen ](https://profiles.wordpress.org/mrallen1/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/feedwordpress-duplicate-post-filter/)