Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

On my website there are a lot of authors and they are all writing about italian 'scene' so sometimes it happens that two of them write the same post or use same title so what I'm looking for is a way to prevent duplicated posts using title comparison. Something like here on stackexchange or that is Built in vBullettin and Data Life Engine. Is there any tutorial, example or even one of you who can help me achieve this?

share|improve this question
    
Are posts being written through wp-admin, or through a custom interface? –  m0r7if3r Jan 20 '12 at 2:24
    
Posts will be written via wp-admin (WordPress default interface) –  maisdesign Jan 20 '12 at 10:33

1 Answer 1

You can hook 'save_post' or 'wp_insert_post' (both executed the same in wp_insert_post()) to check for autosaves and notify the author(s) accordingly. The checks that I would do would be to check that the author of the autosave (aka, revision) and the new autosave are not the same, check that the post title is the same and that the content is SIMILAR, to do it right (enterprise strength) you'd need a decent algorithm, probably based on the counts of words or something like that, to do it quick you can just use strpos() and check if one contains the other. If you need example code, provide as many specifics on the implementation (in a comment) as you can and I'll write it up for you.

share|improve this answer
    
I try to explain as good as I can even if my english isn't perfect. Example: User 1 posts a new post named: Download FREE Inception ITA BdRip then a few hours late user 2 posts a new post named: Inception ITA Download FREE Then I would like to have a notice (before saving) that tells to the User2 that there is already a post with a similiar title and this notice will have a YES/NO button that asks if he is sure to save it. Even something like here on stackexchange will do the trick! –  maisdesign Jan 20 '12 at 15:46
    
any new solution? –  maisdesign Jan 27 '12 at 2:25
2  
Sorry, I've been way to busy to write any serious code like this, these implementation notes should be more than sufficient to get you going though...apologies, but no code is coming. –  m0r7if3r Jan 27 '12 at 2:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.