Function to delete post from category older than 2 days

The get_posts() call is retrieving posts that were published after two days earlier. The after parameter retrieves posts after a certain date, and strtotime() is retrieving the date from two days ago. Try changing after to before, and then change strtotime() first parameter to reflect your request. Researching the get_posts() and strtotime() functions will be … Read more

How to Delete Posts by title?

Like keepkalm said I’d find the list of post IDs from the database: select id, post_title FROM wp_posts where post_title like ‘%Pharmaton%’ or post_title like ‘%Winston Blu%’ or post_title like ‘%Kefir%’ or post_title like ‘%Tetradox%’ or post_title like ‘%Passport Sco%’; and then use the list of IDs with wp-cli’s wp post delete which accepts a … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)