Select Page
Remove post Author from post
Sometimes when i’m developing a membership site i need to test assigning a post author if the code was not right the first time its good to be able to remove the author rather than having to start a new test. <?php $arg = array( 'ID' => 8378, //or whatever the post id is 'post_author' […]

Sometimes when i’m developing a membership site i need to test assigning a post author if the code was not right the first time its good to be able to remove the author rather than having to start a new test.

<?php
$arg = array(
  'ID' => 8378, //or whatever the post id is
  'post_author' => "",
  );
wp_update_post( $arg );

Simply add the above to the functions.php open any page to run and then delete.

Preloader