Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Options::get is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/class-module-view.php on line 131
Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Variable::default_options is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/trait-options.php on line 48
Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Variable::settings is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/trait-variables.php on line 188
Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Functions::exists_push7 is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/trait-variables.php on line 129
Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Variable::sns_list is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/class-module-shortcode.php on line 218
Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Variable::default_options is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/trait-variables.php on line 206
Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Variable::settings is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/trait-variables.php on line 188
Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Functions::exists_push7 is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/trait-variables.php on line 129
Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Functions::get_current_url is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/class-module-shortcode.php on line 219
Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Variable::notification_list is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/class-module-shortcode.php on line 251
Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Variable::default_options is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/trait-variables.php on line 232
Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Variable::settings is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/trait-variables.php on line 188
Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Functions::exists_push7 is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/trait-variables.php on line 129
Deprecated: Calling static trait method VASOCIALBUZZ\Modules\Functions::exists_push7 is deprecated, it should only be called on a class using the trait in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/plugins/va-social-buzz/incs/trait-variables.php on line 235
やっとこAMP対応できた・・・と思ったら、急にGoogleの検索結果の上部に出なくなったりとかありませんか?
もしかするといつの間にかSearch Consoleで今のAMP対応がエラーになってるからかも知りませんよ・・・?
Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/themes/simplicity2/lib/customizer.php on line 4923
Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /var/www/vhosts/freesim.tokyo/httpdocs/wp-content/themes/simplicity2/lib/customizer.php on line 4929
AMP Errorは要注意
以前、Googleの検索結果上部に掲載されたAMPは後からでも更新可能、という話を書きました。
この時、合わせて「エラーに要注意」としましたが、一旦問題なくAMP化できていたコーディングが、Google側でValidationのレベルを上げてあとでエラーになっているケースもあるようです。
Google基準引き上げで勝手にAMPエラーに
WordPressの場合、公式プラグインのAMPを使うことでAMP対応は比較的簡単に出来ます。さらにこのAMPページをWordpressの子テーマのようにカスタマイズする方法はこちらで紹介したとおり。
https://freesim.tokyo/wordpress/wordpress-plugin-amp-easy-customize/
僕もこの方法で運営サイトをガツガツ検索結果上部のAMPカルーセルに載せていたのですが、ある時からパタッと止まってしまいました。
キーワードも盛り込んだしこのやり方ならまず出るはず・・・と思ってふと気づいたのがAMPの構造化データチェック。
そうすると・・・エラーがやっぱり出てました。Logo周りですね。
このサイトのAMPで実例を出してみます。このページのAMPでやってみますね。
https://freesim.tokyo/etc/free-sozai-benrie/
上のカスタマイズ方法を適用して、今現在の構造化データテストツールでチェックするとこうなります。
PublisherのLogoでエラー。前からあるエラーだったのですが、ここの所はこれでも出ていました。AMP側で出していたのかも?

これが現バージョンだとエラーになって、エラーだとAMPは掲載されません。
これを回避するためにはfunctions.phpに以下の記述を追加します。
function _amp_modify_json_metadata( $metadata, $post ) {
$metadata['@type'] = 'NewsArticle';
$metadata['publisher']['logo'] = array(
'@type' => 'ImageObject',
'url' => get_stylesheet_directory_uri() . '/images/logo_amp.png',
'height' => 60,
'width' => 600,
);
return $metadata;
}
add_filter( 'amp_post_template_metadata', '_amp_modify_json_metadata', 10, 2 );
子テーマの中にimages/を作り、そこにlogo_amp.pngでロゴファイルを置きます。高さ60px、幅600pxという長いものですが・・・どこに使われているかは分かりません。
変にサイズを変えるとサイズで警告が出るのでそのままで。
その上で再度構造化データテストツールにかけると・・・

OK!!
記事についているimageは警告が出ていますが、これは軽いものなのでいけるはず。というか投稿ごとにちゃんとデカイのを入れてあげればOK。
こういうのってもうちょっとわかりやすくアナウンスしてほしいかなぁ・・・。