How to Hide Author and Date Information on Your AMP Pages
Content
A common issue for WordPress site owners using the AMP plugin is that author names and publication dates appear on AMP pages even when they have been hidden from the standard, non-AMP version of the site. This discrepancy occurs because the AMP plugin, particularly when using Reader Mode with a Legacy theme, uses its own templates and does not inherit all the settings or CSS from your main theme.
Based on community support threads, this is a frequent request driven by privacy concerns, design preferences, or a desire for a cleaner layout. The good news is that this is almost always solvable with a small code snippet.
Why This Happens
The AMP plugin operates in different modes: Standard, Transitional, and Reader. In Standard and Transitional modes, your active theme is responsible for rendering the AMP pages. Therefore, to modify elements like the author or date, you would typically need to adjust your theme's settings or templates.
However, many themes are not fully AMP-compatible, which often forces the use of Reader Mode. In this mode, the plugin uses its own simplified "Legacy" theme to generate AMP pages. This separate theme does not use the same filters or CSS as your primary theme, which is why your usual methods of hiding this information (e.g., theme options or custom CSS) have no effect on the AMP version.
How to Remove Author and Date from AMP Pages (Reader Mode)
If you have confirmed you are using Reader Mode, you can use a WordPress filter to modify the metadata output. The following code is the most commonly provided and effective solution found in the support forums.
Step 1: Add the following code to your child theme's functions.php file or a custom site-specific plugin. This is the safest method, as it prevents your changes from being overwritten by a theme update.
// Remove author and date from AMP Legacy theme posts
add_filter( 'amp_post_article_header_meta', function( $meta_parts ) {
// Remove the author meta tag
foreach ( array_keys( $meta_parts, 'meta-author', true ) as $key ) {
unset( $meta_parts[ $key ] );
}
// Remove the date/time meta tag
if ( ( $key = array_search( 'meta-time', $meta_parts ) ) !== false ) {
unset( $meta_parts[ $key ] );
}
return $meta_parts;
} );What this code does: The amp_post_article_header_meta filter controls the array of template parts that make up the post metadata (author, date). This code locates and removes the 'meta-author' and 'meta-time' elements from that array before it is rendered on the page.
Step 2: Save the file and clear any caching plugins you may have running on your site. Then, check a post on your mobile device or using a browser's developer tools to simulate a mobile device to see if the author and date are now hidden.
Important Considerations and Alternative Methods
- Check Your AMP Mode: This solution is specifically for sites using Reader Mode with the Legacy theme. You can check your mode in your WordPress dashboard under AMP > Settings. If you are using Standard or Transitional mode, you will need to modify your main theme's templates or contact your theme's support for assistance.
- Template Override (Advanced): Another method is to override the plugin's templates directly. This involves copying a template file (like
meta-time.phpormeta-author.php) from the AMP plugin folder to a new/amp/directory in your child theme and editing it. However, using the filter hook above is generally simpler and more maintainable. - Theme-Specific Plugins: Some popular themes, like Newspaper by tagDiv, bundle their own AMP solutions or mobile theme plugins. In these cases, the standard AMP plugin filters may not work, and you should consult your theme's documentation or support channel.
By using the provided filter, you can gain control over the metadata displayed on your AMP pages and ensure a consistent experience for all your visitors, regardless of the device they use.
Related Support Threads Support
-
Native filters for removing authors do not workhttps://wordpress.org/support/topic/native-filters-for-removing-authors-do-not-work/
-
How to use “AMP disabled” as default setting for new posts?https://wordpress.org/support/topic/how-to-use-amp-disabled-as-default-setting-for-new-posts/
-
Hide featured image on top of postshttps://wordpress.org/support/topic/hide-featured-image-on-top-of-posts/
-
How do I Remove Comment in View-Sourcehttps://wordpress.org/support/topic/how-do-i-remove-comment-in-view-source/
-
How To Show Last Updated Date instead Of Publish Datehttps://wordpress.org/support/topic/how-to-show-last-updated-date-instead-of-publish-date/
-
How can i disable link changer in content?https://wordpress.org/support/topic/how-can-i-disable-link-changer-in-content/
-
Turn off AMP on specific postshttps://wordpress.org/support/topic/turn-off-amp-on-specific-posts/
-
AMP Mobile Version shows Authorhttps://wordpress.org/support/topic/amp-mobile-version-shows-author/
-
Hide Author from Posthttps://wordpress.org/support/topic/hide-author-from-post/
-
Remove date from AMP versionhttps://wordpress.org/support/topic/remove-date-from-amp-version/
-
AMP Legacy reader metadatahttps://wordpress.org/support/topic/amp-legacy-reader-metadata/
-
How to disable AMP with PHPhttps://wordpress.org/support/topic/how-to-disable-amp-with-php/
-
unable to hide Tag shown at bottom of Post in AMP versionhttps://wordpress.org/support/topic/unable-to-hide-tag-shown-at-bottom-of-post-in-amp-version/
-
How to show date and author name on AMP plugin?https://wordpress.org/support/topic/how-to-show-date-and-author-name-on-amp-plugin/
-
How to show date and time on AMP version?https://wordpress.org/support/topic/how-to-show-date-and-time-on-amp-version/
-
How to Remove Avatar & Caption of Featured image From my Amp Pageshttps://wordpress.org/support/topic/how-to-remove-avatar-caption-of-featured-image-from-my-amp-pages/
-
Hiding Gutenberg Metaboxes for Enhanced Editorial Controlhttps://wordpress.org/support/topic/hiding-gutenberg-metaboxes-for-enhanced-editorial-control/
-
Hide the writer’s name and change the way the date appearshttps://wordpress.org/support/topic/hide-the-writers-name-and-change-the-way-the-date-appears/
-
Author and publish datehttps://wordpress.org/support/topic/author-and-publish-date/