Back to Top

How to Automatically Tag Your WordPress Posts?

Auto tagging in Wordpress

WordPress is the most used content management system, but nowadays WordPress is used for developing any kind of site like Restaurant, Job Search, shopping cart etc.

WordPress provides tags system which is used for find matched post or content via keywords. Well, sometimes to add tags manually for every post or content takes much time to find matched keywords and can be a major headache.

Here In the following function, I have explained that to fetch terms of database and check terms are exists into a description of a post when you save a post in WordPress. If term found in the description, will add into the array and consider keyword of the post and add a tag.

Above function will insert term into the database and then assign that term to the particular post.You can place code into theme’s functions.php file.

That’s it.Add above function and save your post and check your tags section in an admin panel.

Further Reading:

To get Current URL in WordPress
To add Tags to the pages in WordPress
WordPress Action Hook

Hope this article helps someone else out.As always, thanks for reading. Don’t Forget to Follow us on Twitter or Subscribe us to Get the Latest Updates.

Comments (1)

  1. Trần hung says:

    Thank you so much for your great post. It’s helpful for me with my problem but … My knowledge in coding is … :(((( So I still get stuck with my current problem. Would you please help me ….
    My trouble: I want to automatically add tags to my product post following this rule : new tags = post title + my pre-defined list words. Example, I have a list with these words: ( word 1, word 2, word 3) and my product post title is: product title. So I want to automatically add tags: product tile word 1, product title word 2, product title word 3. It’s great if you could help. Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Most Popular Posts

How to check user is logged in Modx

Posted on 12 years ago

Bhumi

The Readers’ Poll – June 2012

Posted on 12 years ago

Bhumi