Skip to content

Commit

Permalink
#1839 Add noindex,nofollow in AMP when Dev mode is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
MARQAS committed Mar 12, 2018
1 parent 0b054ac commit 7cc43dc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions templates/features.php
Expand Up @@ -4320,11 +4320,19 @@ function ampforwp_dev_mode(){
global $redux_builder_amp;
if(isset($redux_builder_amp['ampforwp-development-mode']) && $redux_builder_amp['ampforwp-development-mode']){
add_action( 'wp', 'ampforwp_dev_mode_remove_amphtml' );
add_action( 'amp_post_template_head', 'ampforwp_dev_mode_add_noindex' );
}
}
// Remove amphtml from non-AMP
function ampforwp_dev_mode_remove_amphtml(){
remove_action( 'wp_head', 'ampforwp_home_archive_rel_canonical' );
}
// Add noindex,nofollow in the AMP
if ( ! function_exists('ampforwp_dev_mode_add_noindex') ) {
function ampforwp_dev_mode_add_noindex() {
echo '<meta name="robots" content="noindex,nofollow"/>';
}
}
// Notice for Dev Mode
add_action('admin_notices', 'ampforwp_dev_mode_notice');
function ampforwp_dev_mode_notice(){
Expand Down

0 comments on commit 7cc43dc

Please sign in to comment.