WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Need plugin advice: want to scan post content to "auto-categorize" post. (4 posts)

  1. benwisdom
    Member
    Posted 4 years ago #

    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.

    Thanks.

  2. benwisdom
    Member
    Posted 4 years ago #

    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.

    Regards,

    Ben W.

  3. Wealthed
    Member
    Posted 4 years ago #

    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!

  4. CodeAndMore
    Member
    Posted 3 years ago #

    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.
    Thanks.
    Tien[ Signature moderated. ]

Topic Closed

This topic has been closed to new replies.

About this Topic