Forums

What is SQL statement to add a tag to all posts containing a certain word? (2 posts)

  1. sitemaker
    Member
    Posted 3 years ago #

    What would be the SQL statement to add a tag to all posts that contain a certain word?

    For example, I have a recipe blog with over 4,000 entries. Now I decide to make a tag cloud based on certain ingredients; and I can use phpMyAdmin.

    For example: I'd like to add a "ginger" tag to all posts containing the word "ginger"; then a "cardomom" tag to all posts containing "cardomom"; and so on.

    What would be the SQL for this?
    Thanks for your attention.

  2. MichaelH
    Volunteer
    Posted 3 years ago #

    Might look at how the Category to Tag converter does it in wp-admin/import/wp-cat2tag.php

Topic Closed

This topic has been closed to new replies.

About this Topic