13
15

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 5 years have passed since last update.

【Wordpress】予約投稿が失敗した時のチェックリスト

Last updated at Posted at 2015-09-24

だいたいの原因突き止め

予約投稿はwp-cron.phpを実施することで公開される。
なので、wp-cron.php周りがうまく動いてるかどうかを動作チェックする。

wp-cron.phpをサーバ内からアクセスができるか

シェルログインができるなら下記

command
wget http://xxx.com/{wordpress設置ディレクトリ}/wp-cron.php

401が返ってくる場合、アクセス制限がある可能性があるのでその周りチェック、ベーシック認証とか。
最悪、.htaccessに条件付きでアクセスできるように指定すれば200にはなるはず

.htaccess

<Files wp-cron.php>
order deny,allow
deny from all
Allow from xxx.xxx.xxx.xxx #サーバのIP
Satisfy Any
</Files>

wp-cronを無効にする記述をfunctions.phpで記述してないかチェック

何らかの事情でwp-cronを無効化してる記述がある場合はうごかん(そりゃそーだ

functions.php
define('DISABLE_WP_CRON', 'true');

どうしても上記を記入して運用しなくちゃいけない場合は、cronでcron.phpを実行する記述を行う。

cron
0-59/1 * * * * root wget http://xxx.com/wp-cron.php?doing_wp_cron 1>/dev/null 2>/dev/null

いまのとここのどっちかで解決。
プラグインで対応ってのもあるけど、根本解決ではないのでこの辺チェックで。

13
15
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
13
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?