WordPress.org

Ready to get started?Download WordPress

Forums

Oxygen
How to remove a Meta Tag (5 posts)

  1. qualalbatroz
    Member
    Posted 7 months ago #

    Hi Guys,

    So, I'm Trying to get my site past W3C Validation, and one of the errors is the following:

    Bad value template for attribute name on element meta: Keyword template is not registered.
    <meta name="template" content="Oxygen 0.5"/>

    So I'm thinking I'll just remove the thing from the Code completely. But I just can't find it, wouldn't you know.

    It should be in the header.php file, right? Wrong.
    Can you help?

    You can see my site here: http://www.qualalbatroz.pt

    Let me thank you in advance.

  2. mikedev
    Member
    Posted 7 months ago #

    Ensure you are using a child theme so you can edit code without it later being over-written with a theme update: http://codex.wordpress.org/Child_Themes.

    Create a functions.php file: http://codex.wordpress.org/Child_Themes#Using_functions.php.

    Inside functions.php add this code:

    function remove_hybrid_meta_template() {
        remove_action( 'wp_head', 'hybrid_meta_template', 1 );
    }
    add_action( 'init', 'remove_hybrid_meta_template' );

    See "Removing Actions and Filters" in http://codex.wordpress.org/Plugin_API.

    remove_hybrid_meta_template is just a name I made up.

    remove_action removes add_action( 'wp_head', 'hybrid_meta_template', 1 ) called in /wp-content/themes/oxygen/library/hybrid.php.

    hybrid_meta_template is defined in /wp-content/themes/oxygen/library/functions/utility.php.

  3. qualalbatroz
    Member
    Posted 6 months ago #

    Hey mikedev,

    Thank you so much! This solved my problem. Thank you. And thank you for explaining the solution.

    I still have another similar problem, and You might be able to help me with that one too.

    Validation doesn't like this line in my Header:
    <meta http-equiv="Content-Language" content="pt-BR" />

    what would be the code to remove this bit?

    Oh, and a Happy new Year!

    Thanks, Marc

  4. mikedev
    Member
    Posted 6 months ago #

    That meta tag is added by the qTranslate plugin. Here's the same issue: http://wordpress.org/support/topic/plugin-qtranslate-content-language-meta-is-obsolete-in-html5

    The code is in /wp-content/plugins/qtranslate/qtranslate_hooks.php.

    First try remove_action('wp_head', 'qtrans_header'); in your child theme functions.php, but that will remove everything in qtrans_header, some of which you might need.

    The other option is to copy all of qtrans_header into your child theme functions.php, rename it to something like qualalbatroz_qtrans_header, comment out the Content-Language line, then add_action('wp_head', 'qualalbatroz_qtrans_header');.

  5. qualalbatroz
    Member
    Posted 6 months ago #

    remove_action('wp_head', 'qtrans_header');

    This worked just fine it seems there was nothing important in the qtrans_header. just a bit of useless css. there is so much clutter in wordpress because of all the diferente stuck on bits a site is made of.

    Let me thank you again for sharing your knowledge.

    All the best for 2014.

Reply

You must log in to post.

About this Theme

About this Topic