How to set posts to draft in bulk based on the content of the post

You could try to loop through all the posts and if the content contains the link, call this: change_post_status(get_the_ID(),’private’); or try draft if appropriate. Register this function first: function change_post_status($post_id,$status){ $current_post = get_post( $post_id, ‘ARRAY_A’ ); $current_post[‘post_status’] = $status; wp_update_post($current_post); }

Custom Bulk Actions handler not firing

Hi first fix your condition if ( $action !== ‘out_of_stock’ || $action !== ‘in_stock’) { this condition will always run because your action is in contrast with “out_of_stock” or “in_stock”. So I think if you change the condition from OR to AND it will work. Then find out if the screen id is the one … Read more

How to change my 3000 Published post status to Draft using PHPMyAdmin

If you have access to phpMyAdmin you can run this SQL query directly: UPDATE {prefix}posts SET post_status=”draft” WHERE post_status=”publish” If you do not have any experience with SQL queries then you should use this solution. Just place this code in functions.php and refresh the WordPress once, and it will be done. function setPostsToDraft() { global … Read more

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