• Resolved DejaViewstream Admin

    (@disneydejavu)


    every result i see you guys telling people how to remove TAGS from AMP posts shows screenshots to options that dont exist on my wordpress amp settings.

    This is what my options look like – https://snipboard.io/sTCjyv.jpg

    I want the tags GONE from posts i do via AMP! the tags i post should not all be publicy seen, it looks very sloppy! I am getting help with CSS to remove them from posts viewed normally but my understanding is even when that happens AMP will continue to show them…

    thanks in advance for any help.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Milind More

    (@milindmore22)

    Hello @disneydejavu

    Thank you for the support topic, we are not sure which results you are talking about, we do not provide any option to remote tags as it’s something users do not ask frequently.

    As we checked your site you seems to be using AMP plugin 2.1.4 in Reader Mode with Legacy theme.

    Please add one of the code snippet from below in your active themes functions.php or in a custom plugin based on your requirement.

    1) Remove both Categories and Tags from AMP Legacy Theme.

    /**
     * Remove meta-taxonomy from AMP page.
     *
     * @param array $template_parts template parts.
     * @return array template parts.
     */
    function custom_amp_remove_footer_taxonomy( $template_parts ) {
    	$key = array_search( 'meta-taxonomy', $template_parts, true );
    	if ( false !== $key ) {
    		unset( $template_parts[ $key ] );
    	}
    	return $template_parts;
    }
    
    add_filter( 'amp_post_article_footer_meta', 'custom_amp_remove_footer_taxonomy' );

    2) Remove Just Tags from AMP Legacy theme

    
    add_action( 'the_tags', 'amp_remove_tags' );
    
    /**
     * Remove tags on AMP legacy theme.
     * 
     * @param array $tag_list Tag List.
     * @return array
     */
    function amp_remove_tags( $tag_list ) {
            // condition to check AMP page.
    	if ( function_exists( 'amp_is_request' ) && amp_is_request() ) {
    		return array();
    	}
    	return $tag_list;
    }

    3) Remove Just Categories from AMP Legacy theme.

    /**
     * Remove Categories from AMP legacy theme.
     * 
     * @param array $categories Categories.
     * @return array
     */
    function amp_remove_legacy_theme_categories( $categories ) {
    	if ( function_exists( 'amp_is_request' ) && amp_is_request() ) {
    		return false;
    	}
    	return $categories;
    }
    
    add_filter( 'the_category', 'amp_remove_legacy_theme_categories' );

    Hope this Helps!

    • This reply was modified 3 years, 2 months ago by Milind More.
    Thread Starter DejaViewstream Admin

    (@disneydejavu)

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘hide tags on AMP posts’ is closed to new replies.