Comments satyanandi191 started the conversationMarch 3, 2025 at 4:25pmi want to delete post shown below admin name, it looks odd. when i click in author name, it gives author details but shows posts details which looks so odd. i attach two snap shots.Attached files: Screenshot 2025-03-03 215017.png Screenshot 2025-03-03 215036.png 2,786PenciDesign repliedMarch 3, 2025 at 4:38pmHi, You should paste this code into the function.php of the child theme or via the CodeSnippet plugin here: https://wordpress.org/plugins/code-snippets/ function penci_user_remove_author_posts( $query ) { if ( ! is_admin() && $query->is_main_query() && $query->is_author() ) { $query->set( 'post__in', array(0) ); // Prevents any posts from being displayed } } add_action( 'pre_get_posts', 'penci_user_remove_author_posts' ); Regards,PenciDesign. Sign in to reply ...
i want to delete post shown below admin name, it looks odd. when i click in author name, it gives author details but shows posts details which looks so odd. i attach two snap shots.
Attached files: Screenshot 2025-03-03 215017.png
Screenshot 2025-03-03 215036.png
Hi,
You should paste this code into the function.php of the child theme or via the CodeSnippet plugin here: https://wordpress.org/plugins/code-snippets/
function penci_user_remove_author_posts( $query ) { if ( ! is_admin() && $query->is_main_query() && $query->is_author() ) { $query->set( 'post__in', array(0) ); // Prevents any posts from being displayed } } add_action( 'pre_get_posts', 'penci_user_remove_author_posts' );
Regards,
PenciDesign.