WordPress.org

Ready to get started?Download WordPress

Forums

WP Crontrol
Delete a post by content with WP-Crontrol (1 post)

  1. dEM0nsTAr
    Member
    Posted 1 year ago #

    I want to delete posts with a specific content automatically with WP-Crontrol.
    I have added the following cron job but it doesn't do anything:

    global $wpdb;
    $result = $wpdb->get_results( "SELECT ID FROM wp_posts WHERE post_content LIKE 'Content which should result in a deletion of this post'" );
      if ($result){
        foreach($result as $pageThing){
          wp_delete_post($pageThing);
        }
      }

    How can I make it work?
    Thanks

    http://wordpress.org/extend/plugins/wp-crontrol/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.