query - how to insert missing tags into the posts through mySQL?

admin2025-01-08  4

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?

Share Improve this question asked Jul 24, 2014 at 19:54 Stewie GriffinStewie Griffin 1091 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 0

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.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736266831a1152.html

最新回复(0)