How to disable contributor archive in WordPress

0

Note for disabling contributor archives in WordPress.

Write the following code from the WordPress admin screen to "Appearance→", "Theme Editor", → "Function.php"


function disable_author_archive( $query ){ if( !is_admin() && is_author() ){ $query->set_404(); status_header( 404 ); nocache_headers(); } } add_action( 'parse_query', 'disable_author_archive' );

If you want to change jobs from inexperienced IT, IT Career Change Lab

Share:
0
藤堂 楓
Author by

藤堂 楓

Updated on March 08, 2022