Support » Plugins » Need plugin advice: want to scan post content to “auto-categorize” post.

  • Resolved benwisdom


    I have an idea for a plugin that would greatly improve the productivity on a website that I run. I searched to see if anyone else has made a plugin to do what I have in mind and haven’t found anything, so I want to see if I can do it myself.

    I haven’t ever written a plugin before and need some advice as to what WP functions and API hooks I could use to accomplish the following:

    Upon the saving of a particular post, the content of the post is scanned for category slugs. For each category slug found, the corresponding category is automatically selected for that post.

    I would like to write a plugin to do this because I use over four hundred categories on this particular website, and I use the category slugs as CSS class names to define the style of different words in a post’s content, like so:

    <span class="uf">Behold, it was <span class="ps">all grown over with</span> <span class="pfv">thorns</span>. <span class="pds">Its surface was covered with</span> <span class="pfv">nettles</span>, <span class="stf">and its stone wall was broken down</span>. </span>

    [I hope that excerpt shows up properly.]

    If I could classify the words in each post and then just save the post and have WordPress automatically pick the categories, it could easily double my productivity because I wouldn’t have to pick out each category manually.

    Is this a feasible idea for a plugin? What WordPress functions should I use? Is there a search function that I could use in the plugin to scan the post content? Any advice would be very helpful.


Viewing 3 replies - 1 through 3 (of 3 total)
  • The good folks at Code and More helped me by writing the WordPress plugin described above. You can find the file on my website here.

    There is a minor issue with the plugin, in that it takes a manual unselection and a second save to unselect the default category (Cat_id=1) from the post being saved. But hopefully that will be resolved soon.

    I hope this is helpful.


    Ben W.

    Hey Benwisdom,

    I was wondering if you could tell me how to use the Auto-Category plugin that you mentioned. The developers website is down right now and I cannot for the life of me figure out how to use it. I have activated the plugin but I cannot find where to auto-categorize my posts anywhere, I checked in edit post, categories and under plugin settings but I don’t see it.

    Thanks in advance!

    From CodeAndMore, thank you Ben for mentioning us.
    For other uses, please note that this auto categorize plugin works on specific data format, it is not intelligent enough to work with any data.
    Tien[ Signature moderated. ]

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Need plugin advice: want to scan post content to “auto-categorize” post.’ is closed to new replies.