I am looking for a SQL query to insert a tag to multiple posts from a specific category. A pseudo query looks something like this:

VALUES TAG = "tagName"
where Posts in_category("categoryName")

how would such sql look for WP tables?


You should not modify the wordpress DB via SQL unless it is a total emergency. Wordpress DB structure getting more complex with time and there are always possible intractions with plugins that you might bypass with direct SQL.

What you should do is to write a small plugin that inserts the tags by calling using the relevant APIs.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.