1

I have about 500 posts published in WordPress now I want to add one same comment on every post. How to do the by the database. I search about it, but not a good luck. thanks in advance for the help.

3

It would be safer to use [wp_insert_comment()][1] rather than manually through MySQL. WP often inserts data in multiple tables - using its core functions helps ensure that all of the data gets added in all of the right tables.

I'd suggest creating a query to pull all published posts. Then, set up a foreach loop that calls wp_insert_comment() on every post, thus inserting the comment on each one.

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.