WordPress.org

Forums

Automatic Post Tagger
[resolved] Related Words for Categories (26 posts)

  1. Duke
    Member
    Posted 11 months ago #

    I like your plugin in that it is great for auto-blogging. Any plans to have the plugin work for categories like you do for tags? I would like to look at the incoming title and have it automatically set both my tags and categories. Right now it's just doing it for tags. Thanks

    https://wordpress.org/plugins/automatic-post-tagger/

  2. Devtard
    Member
    Plugin Author

    Posted 11 months ago #

    Sure - the version 1.6 will support custom taxonomies. It's not going to be very user-friendly though (in order to add both tags and categories users will have to run two instances of the plugin) because there are more important things that need to be implemented in that release.

  3. Duke
    Member
    Posted 11 months ago #

    Sounds good. When you think 1.6 will be out?

  4. Devtard
    Member
    Plugin Author

    Posted 11 months ago #

    It may take a few weeks, a month or maybe even two. Honestly I don't know - there is still a lot of things on my to-do list. Proper testing will also require some time.

  5. Duke
    Member
    Posted 11 months ago #

    Do you know of another plugin that does it for categories? I can't seem to find one.

  6. Devtard
    Member
    Plugin Author

    Posted 11 months ago #

    In this thread (which can help you if you want to modify the plugin yourself to add categories instead of tags) somebody also posted a link to this plugin which should be able to do what you want - but I haven't tried it so I don't know if it actually works.

  7. Duke
    Member
    Posted 11 months ago #

    Hi,

    I took a look at the thread you mentioned and it gets a little confusing for me...sorry.

    So I hope you can provide some simple steps needed to convert the plugin to work with categories instead of tags. I'll still be using your original APT plugin for tagging, so please, if you can, show me how to modify the plugin for categories so that it doesn't conflict with the original plugin.

    This is what I've gathered so far.

    1) That we need to modify the original plugin's code and that we can run the two plugins simultaneously, one for tagging and one for setting categories. That's fine with me, but I need to know how to modify the plugin.

    2) So far I understand that we need to replace all occurrences of "apt_" with something like "abc_". This will rename the added option names and the custom database table.

    3) Then I understand we need to rename the plugin to something else. Where do we do that or do we? Maybe that is what the step above does?

    4) And I gather that we need to change the "post_tag" parameter to "category". I see someone mentioned to find all mentions of 'post' and change those to 'category'. Can you tell me which lines to do that on? Or can I simply do the Find/Replace function to change all the mentions of 'posts' to "category'?

    5) Then I see the same person mentioned to look for ## ADDING TAGS TO THE POST, then to add something like:

    foreach ($apc_tags_to_add_array as $apc_cat) {
    $term = get_term_by('name', $apc_tag, 'category');
    $apc_tag_ids[] = $term->term_id; }

    Where exactly would we add that? Would it go right after the line that says ## ADDING TAGS TO THE POST?

    6) Then he said to replace

    wp_set_post_terms($post_id, $apc_tags_to_add_array, 'category', true); //append tags

    with...

    wp_set_post_terms($post_id, $apc_tag_ids, 'category', true); //append tags

    And to repeat it with the same function immediately below. I see that but want to make sure.

    Instead of being all over the place, can you please list the steps needed to modify the plugin so that works along side the original APT plugin.

    The whole process is not clear on that thread so was hoping you could clear it up here with a few simple steps.

    Thanks

  8. Devtard
    Member
    Plugin Author

    Posted 11 months ago #

    Here's a modified version of APT v1.5 I just put together - it should be able to add (already existing) categories to posts:

    http://devtard.com/wp-content/uploads/2014/05/apt-modified.zip

    Unfortunately I don't have time to properly test it or make it more user friendly. Check it out and let me know if it works for you.

    And if you have any suggestions or comments, please tell me - I probably won't be able to tweak everything for you but I will take them into account before releasing 1.6 (which already supports custom taxonomies).

    (You can use a diff tool to see what has been changed in comparison to the version 1.5.)

  9. Duke
    Member
    Posted 11 months ago #

    Yes, that is what I want...to add already existing categories to posts. Now since I already have APT installed on my site, how do I install this modified version? Do I have to deactivate/remove the orginal version fist, then install/activate this one?

    Thanks

  10. Devtard
    Member
    Plugin Author

    Posted 11 months ago #

    All prefixes, DB names etc. have been changed so it should be safe to run both plugins at the same time. There's no need to deactivate the original plugin.

    It may be a good idea to make a backup of all your data though (just in case something goes wrong).

  11. Duke
    Member
    Posted 11 months ago #

    Sounds good. I will backup everything, then install this plugin and let you know how it goes. I might have a few suggestions. Thanks

  12. Duke
    Member
    Posted 11 months ago #

    I backed up everything and loaded up your modified version of the plugin. I see that the backend still needs some language clean up but so far so good. I would recommend that when it does the 'Import Existing Tags/Category" function that it pre-fills the 'Related Words' right column with the same data that it shows on the left column for the different 'tag/category names'. I think most the keywords we would be looking for in the title would also be used for our tags and categories. I might be wrong, but I have over 230 categories and it would be a pain to copy all of them over one-by-one. I guess I could go into the database table and do it from there. Another suggestion is to maybe have an option next to the 'Import Existing Tags/Category" button asking if we wanted to our right side column match our left side imported column. Don't know how you would word that or even if it's possible to be done in the first place, but that's my suggestion so far.

    I will play around with the rest of it and see how it works with my auto-blogger. FYI, I am importing videos from RSS feeds and so far it tags the videos fine with APT. I want to see if it will properly categorize them too by doing a title scrub for the selected keywords. If it works out, then I might not have to run 230+ different campaigns with my autoblogger just to get the videos to go into the right category. I hope to be able to run just one campaign and have your modified version of the plugin post the videos to the right category as they are being pulled from the feed.

    I will report back on how it goes. Thanks

  13. Devtard
    Member
    Plugin Author

    Posted 11 months ago #

    I would recommend that when it does the 'Import Existing Tags/Category" function that it pre-fills the 'Related Words' right column with the same data that it shows on the left column for the different 'tag/category names'. I think most the keywords we would be looking for in the title would also be used for our tags and categories. I might be wrong, but I have over 230 categories and it would be a pain to copy all of them over one-by-one. I guess I could go into the database table and do it from there.

    Another suggestion is to maybe have an option next to the 'Import Existing Tags/Category" button asking if we wanted to our right side column match our left side imported column.

    Why would you want to have both the keyword names and related words the same? (APT v1.5 looks for both in posts - this can be changed in v1.6 BTW)

    I'm not exactly sure what you want to do. Could you please elaborate more on this?

  14. Duke
    Member
    Posted 11 months ago #

    Let's say the post title contains the keyword "Incredible Hulk". I would want that to be posted in the 'Incredible Hulk' category. We might have another video titled with the keyword "Incredible Adventures" so I don't want that to go to the "Incredible Hulk" category, but to the "Incredible Adventures" category. Of course this would all be setup in the settings.

    Remember I am dealing with importing movies so it might not be the same for everyone. But for me, it would be a heck of a lot easier if 'Importing Existing Categories' to have the right column filled with keywords that match the left column of categories.

    Not always will it be like that, so it's nice to be able to adjust the wording with the way you have it in the keyword column. If it started with the exact match, then I can always add more keywords to it or take some of the pre-filled keyword and modify it. But having the first keyword displayed to match the category would make things a lot easier.

    Also, like before, it would be good to increase the character limit of the keyword column to more than 255 characters. Some categories would have a lot of different keywords going into them so maybe set the limit to around 5000 or so.

    Hope it clarifies things a little.

  15. Duke
    Member
    Posted 11 months ago #

    Another update...

    I ran a campaign with my autoblogger and the issue seems to be with it rather than your plugin maybe. The autoblogger doesn't have a way to disable posts from going to a certain category. It defaults to 'uncategorized', which probably makes sense. There isn't an option for choosing 'None' or 'Don't Categorize', so when it runs it's posting to 'uncategorized' every time. Your plugin doesn't seem to pick it up before all that happens. I was hoping it would correct the category before the final posting, but it doesn't. I might have to get with the autoblogger Dev and see if they can make it an option to select "none" on their tool for category, but they will probably want all misguided posts to go to 'uncategorized'.

    Do you see a way to get past that? Maybe I should try it with different settings at the top. Maybe select "Replace old tags with newly generated tags". Will be right back.

  16. Duke
    Member
    Posted 11 months ago #

    Yepper by selecting "Replace old tags with newly generated tags" it did the trick. Now it auto-blogs and goes to the right category with the right tags using both APT and your modified version of the plugin for categories. This is better than using WP Robot. I'm stoked.

    I really don't have any suggestions from here other than what I mentioned above. Super Thanks!!

  17. Devtard
    Member
    Plugin Author

    Posted 11 months ago #

    Let's say the post title contains the keyword "Incredible Hulk". I would want that to be posted in the 'Incredible Hulk' category. We might have another video titled with the keyword "Incredible Adventures" so I don't want that to go to the "Incredible Hulk" category, but to the "Incredible Adventures" category. Of course this would all be setup in the settings.

    But that should already work just fine (as long as you don't use the related word "incredible" for both categories/keyword names), right?

    Remember I am dealing with importing movies so it might not be the same for everyone. But for me, it would be a heck of a lot easier if 'Importing Existing Categories' to have the right column filled with keywords that match the left column of categories.

    If you export all the keywrods into a CSV file and then open it in a spreadsheet editor, you can easily duplicate the column manually, edit it, save as a CSV file and import it into APT. This seems easier to me than implementing a new function :P

    Yepper by selecting "Replace old tags with newly generated tags" it did the trick.

    Cool, I'm glad that works.

  18. Duke
    Member
    Posted 11 months ago #

    Sounds good to me. Actually let me modify my suggestion since now I have to "Replace old tags with newly generated tags". I really don't want more than one keyword in the keyword column now. If I put a few dozen keywords in there, then I would have a super long category, which is not good. So if I just did like you said I could download to CSV and upload with the copied over content. That works for me and it's good the way it is. Super thanks for the help.

  19. Duke
    Member
    Posted 11 months ago #

    After thinking about this for a bit, I think it would be good to not have to select "Replace old tags with newly generated tags". I really would like to keep it at "Do Nothing". Reason is I don't want my categories changing once I have them set. I will be feeding from different RSS feeds and they might not be using the same exact keywords in their titles. So I need to be able to vary the keywords and keep the category constant. Is this possible? If not, I guess I will have to stay with having many category specific campaigns with my autoblogger. Thanks and sorry to open this back up.

  20. Devtard
    Member
    Plugin Author

    Posted 11 months ago #

    The version 1.6 can delete all old tags if no new keywords are found - in this case it would delete the category "Uncategorized" if no relevant keywords were found in the post - is that what you want to accomplish?

  21. Duke
    Member
    Posted 11 months ago #

    Since I am feeding from multiple websites, I need to keep the categories constant otherwise it would be confusing to have different categories for the same movies. Actually they are not movies, but actual tv shows that run everyday. It could be the case where one website titles their tv show "Incredible Hulk May 20 2014" which would go to the category "Incredible Hulk" and another site might title their show 'Incredible-Hulk May 20 2014' and it would go to the 'Incredible-Hulk' category. A small difference yes, but it would create two categories for the same show. This would mess up the site with so many categories being created. So I can't have it change categories when posting. It has to keep the categories constant.

    I would like the left side column to pull in all existing categories that I've setup using the 'Import Existing Categories' function and not let them be changed by your plugin. Then I would like the right side column for keywords to be dynamic so that I can add different possible variations of keywords since each website might not have the same exact keyword in the Title that matches the categories I have in place. This way I can make sure to keep the keywords unique for each category.

    Thanks

  22. Devtard
    Member
    Plugin Author

    Posted 11 months ago #

    If your keyword/category name is "Incredible Hulk" and your related words contain something like this "incredible-hulk" or "incredible*hulk" (the asterisk can be used as a placeholder for any character/string) then in both these cases the post should be added to the right category. Does that answer your question or have I not understood it at all? (If that's the case, what exactly is the problem?)

  23. Duke
    Member
    Posted 11 months ago #

    I'm going to run it for a few days and see what happens. I might not be too familiar with the setup as far as using the asterisk etc but that might be the part I'm missing. It was easy for tags but I was just feeding from one website. I am now ramping up and starting to feed from other sites, so will see how she runs. I will report back, but for now it's just testing time.

  24. Duke
    Member
    Posted 11 months ago #

    To update you I've been running your Post Tagger for Tags and Categories with no issues. Great work!

  25. Devtard
    Member
    Plugin Author

    Posted 11 months ago #

    I'm glad to hear that. :)

  26. Devtard
    Member
    Plugin Author

    Posted 9 months ago #

    I just updated the plugin and also created a new modified version which can be used separately to add categories. It can be downloaded here: http://devtard.com/wp-content/uploads/2014/07/automatic-category-adder.zip (see this page for more information)

Reply

You must log in to post.

About this Plugin

  • Automatic Post Tagger
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic