0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

wordpressで投稿者アーカイブを無効化する方法

Last updated at Posted at 2022-03-01

WordPressで投稿者アーカイブを無効化するためのメモ。

WordPress管理画面から「外観」→「テーマエディター」→「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' );

IT未経験からの転職なら未経験IT転職ラボ

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?