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:
INSERT INTO POSTS
VALUES TAG = "tagName"
where Posts in_category("categoryName")
how would such sql look for WP tables?
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:
INSERT INTO POSTS
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.