0
0

More than 1 year has passed since last update.

[WordPress] コメントを無効にする

Posted at

WordPress でコーポレートサイトなどを作成し場合、コメント機能は不要なので無効にしておきたいのですが、よく忘れるのでメモ。

コメント機能の無効化は wp-cli で

wp option update default_comment_status closed
wp option update default_ping_status closed
TABLE_PREFIX=$(wp eval 'global $table_prefix; echo $table_prefix;')
wp db query "UPDATE ${TABLE_PREFIX}posts SET comment_status='closed', ping_status='closed';"

Nginx に設定追加して /wp-comments-post.php へのリクエストも無効化しておけばなお良い

location ~* /wp-comments-post\.php$ { deny all; }
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