• jeroenvip

    (@hieronymusdesign)


    Hello guys.

    Perhaps you can help me. I got a script that needs to delete a WordPress post when the title is the same as this value.

    As wp_delete_post($id) works with the ID. How to…

    $subject = Outside title

    Now i want WordPress to delete the post what has “Outside title” as title.

    How do i do this?

    I tried:

    $args = array(“post_title” => “$subject”);
    $posts = get_posts($args);

    print_r ($posts);

    No result so far. Thank you very much in advance

Viewing 2 replies - 1 through 2 (of 2 total)
  • Try $args = array("post_title" => $subject); (no quotes around $subject)

    Thread Starter jeroenvip

    (@hieronymusdesign)

    Programming at Friday doesn’t do people any good. Thanks for the response its working.

    Have a nice weekend

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Delete WordPress post from post_title perspective’ is closed to new replies.