Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author George Notaras

    (@gnotaras)

    Hello, thanks for the kind words!

    There is a wiki page with general information about the filtering and customization of the metadata you might find interesting.

    Below I provide an example about how to attach a filtering function to the amt_opengraph_metadata_head hook and process the generated Opengraph metadata by filtering out the article:author meta tag.

    function my_opengraph_filtering_function( $metatags ) {
        $metatags_new = array();
        foreach ( $metatags as $metatag ) {
            if ( strpos($metatag, 'article:author') === false ) {
                $metatags_new[] = $metatag;
            }
        }
        return $metatags_new;
    }
    add_filter( 'amt_opengraph_metadata_head', 'my_opengraph_filtering_function' );

    This can be added to the functions.php file of the theme or in a custom plugin.

    Hope this helps!

    George

    Plugin Author George Notaras

    (@gnotaras)

    In the next release, this going to be easier. I’ll keep you updated.

    Plugin Author George Notaras

    (@gnotaras)

    Working alternative sample code which will be valid with v2.10.10.

    function my_opengraph_filtering_function( $metatags ) {
        unset( $metatags['article:author'] );
        return $metatags;
    }
    add_filter( 'amt_opengraph_metadata_head', 'my_opengraph_filtering_function' );

    This is much simpler. Please note that the above snippet will still work as expected.

    Thread Starter Salentomane

    (@salentomane)

    Thanks George, code work well!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Filter for Remove author’ is closed to new replies.