I really like how Stack Exchange sites handle posts, where after you finish typing the title it will list out similar titles. How can I implement something similar on my WordPress installation?
The reason being is that hopefully it will show duplicate titles at the top, so that I do not accidently publish a post with the same title as an older post.
This will get you most of the way there, but the actual search is not perfect. It would be great if someone who knows more about $wpdb can help get a better result.
If this is my original post title: SOPA is dead, woot!
Then just a title of “SOPA” will find it, as will just a title of “is dead” but not “Ding dong, the witch is dead” or “SOPA is a bad idea”.
However, the basic premise is a button is added to “Check Title”, and when pressed, the title is posted with jQuery and handled via AJAX to return matching titles, excluding the current post. If you are able to take this and modify it to return better matches, please share!
Here is the base plugin code, followed by the jQuery which should be included in your plugin folder in a file called duptitles.js
Begin jQuery for duptitles.js