• Hi! I wondered if there was a way to delete or remove a user without losing their “by” line on their posts? I’m hosting a bunch of guest posts this month but won’t be afterwards and would like to take off their ability to log in and such after they’ve posted. Thanks so much!

Viewing 4 replies - 1 through 4 (of 4 total)
  • When you delete a user, you can assign their posts to a new one. I don’t think that there’s a way to keep them in there once deleted.
    What you could do is just change their password, so that they can’t log back in or change the code in your template and use a custom field for the author.

    If you already have a lot of posts, perhaps the first option is easier.

    Thread Starter SomeOddGirl

    (@someoddgirl)

    Thanks for the quick reply Christine! Do you think there would be a way to make the custom field optional? So I wouldn’t have to fill it in with each post unless it was different (like give it a default)? If not then you’re right, the first is probably easier ??

    Yes, you could try a conditional statement.. something like this:

    <?php while (have_posts()) : the_post();
    $link=get_post_meta($post->ID, 'author', true);
    if($author != '') {
     echo 'Written by '.$author;
    }
    else {
     echo 'the default name';
    }
    the_content();
    endwhile; ?>
    Thread Starter SomeOddGirl

    (@someoddgirl)

    You are awesome Christine! Thanks tons! I’ll try that or go with the other option if it doesn’t work out ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to delete User without losing their post credit’ is closed to new replies.