LoginSignup
0
0

More than 3 years have passed since last update.

Wordpress AMP・RSSの投稿者情報を削除する

Posted at

製品サイトなどに、投稿者情報としてユーザ名が出るのもなぁと思い調査。
Wordpressではテンプレートとされている各ページ(AMP、RSS)の修正点について、下記に整理する。

  • WordPress Version: 5.4.2

AMPページの投稿者情報を削除する

wordpress/htdocs/wp-content/plugins/amp/templates/meta-author.php

  • chownで編集可権限にしたあと、下記のように該当部分をコメントアウト
meta-author.php
 <?php /*if ( $post_author ) : ?>
    <div class="amp-wp-meta amp-wp-byline">
        <?php if ( function_exists( 'get_avatar_url' ) ) : ?>
            <amp-img src="<?php echo esc_url( get_avatar_url( $post_author->user_email, [ 'size' => 24 ] ) ); ?>" alt="<?php echo esc_attr( $post_author->display_name ); ?>" width="24" height="24" layout="fixed"></amp-img>
        <?php endif; ?>
        <span class="amp-wp-author author vcard"><?php echo esc_html( $post_author->display_name ); ?></span>
    </div>
 <?php endif;*/ ?>

RSSページの投稿者情報を削除する

wordpress/htdocs/wp-includes/feed-rss2.php

  • 下記のように該当部分をコメントアウト
feed-rss2.php
 <?php /* <dc:creator><![CDATA[<?php the_author(); ?>]]></dc:creator> */ ?>
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