• Resolved Datadama

    (@datadama)


    How do I remove parts of an old meta tag?
    On my blog’s front page I see some “leftovers” from a meta tag. Looks like: “> “>
    When using inspect tools in the browser (html) it seems to be located in the body of my blog page (home page), but I have not been able to locate it in any php-pages.

    [ Moderator note: code fixed. Please wrap code in the backtick character or use the code button. ]

    <body class="blog logged-in admin-bar customize-support">
        ">
        <meta keywords"="" content="<meta name=" name="keywords"></meta>
        ">

    How do I find (and destroy!) these annoying leftovers?

Viewing 8 replies - 1 through 8 (of 8 total)
  • does this only show in the blog’s front page?

    the <body> tag is usually in header.php of a theme;
    but could be different …
    what theme are you using?

    does the problem persist if you temporarily switch to the default theme Twenty Fifteen?
    does the problem persist if you temporarily deactivate all plugins?

    Thread Starter Datadama

    (@datadama)

    It only appears on the blog’s front page.
    Cannot be found in header.php.
    Using my own themes, this is the first time I’ve not been able to locate error like this one.
    The problem accured before adding any plugins.

    I have tried to use another theme, deleted my theme and reinstalled it, – no use.

    It only appears on the blog’s front page.

    check the files index.php, front-page.php, home.php if they exist…

    also check functions.php or any existing other files with functions.

    if the stray output disappears while you are using the default theme Twenty Fifteen, the code is probably in one of your theme’s files.

    Using my own themes

    are these based on any commonly available themes?

    Thread Starter Datadama

    (@datadama)

    I’ll check the files suggested.
    Using sort of templates based themes, but not commonly available. It’s not a problem with the themes it selves. Used them a lot. This has to do with me removing a meta tag before publishing, but somehow these useless little tag-leftovers was left behind…

    me removing a meta tag before publishing

    which file did you edit to remove the meta tag? or how did you do it?

    does the problem also show if you are logged-off?

    what is the full code of header.php (assuming that that file contains the body tag)?

    ar you using any cache plugins?

    can you provide a live link to the effected site?

    Thread Starter Datadama

    (@datadama)

    Problem was there before installing any plugins. Only Jetpack installed.

    The site:
    https://www.sunndal-fjellstyre.no/

    header.php:

    <?php global $wp_locale;
    if (isset($wp_locale)) {
    	$wp_locale->text_direction = 'ltr';
    } ?>
    <!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    <meta charset="<?php bloginfo('charset') ?>" />
    <title><?php wp_title( '|', true, 'right' ); ?></title>
    
    <meta name="description" content="<?php if ( is_single() ) {
            single_post_title('', true);
        } else {
            bloginfo('name'); echo " - "; bloginfo('description');
        }
        ?>" />
    
    <meta name="viewport" content="initial-scale = 1.0, maximum-scale = 1.0, user-scalable = no, width = device-width" />
    <!--[if lt IE 9]><script src="https://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
    
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url') ?>" media="screen" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    <?php
    remove_action('wp_head', 'wp_generator');
    if (is_singular() && get_option('thread_comments')) {
    	wp_enqueue_script('comment-reply');
    }
    wp_head();
    ?>
    </head>
    <body <?php body_class(); ?>>
    
    <div id="main">
    
    <?php if(theme_has_layout_part("header")) : ?>
    <header class="header<?php echo (theme_get_option('theme_header_clickable') ? ' clickable' : ''); ?>"><?php get_sidebar('header'); ?></header>
    <?php endif; ?>
    
    <div class="pageslider">
    
         <div class="shapes">
                </div>
    <div class="slider slidecontainerpageslider" data-width="1920" data-height="250">
        <div class="slider-inner">
    <div class="slide-item slidepageslider0">
    
    </div>
    
        </div>
    </div>
    <div class="slidenavigator slidenavigatorpageslider" data-left="1" data-top="1">
    <a href="#" class="slidenavigatoritem"></a>
    </div>
    
    </div>
    <div class="sheet clearfix">
                <div class="layout-wrapper">
                    <div class="content-layout">
                        <div class="content-layout-row">
                            <div class="layout-cell content">

    the stray output comes from this section:

    <meta name="description" content="<meta name="description" content="Sunndal fjellstyre er et kommunalt valgt styre for Sunndal statsallmenning.">">
    <meta name="keywords" content="<meta name="keywords" content="Sunndal, fjellstyre, friluftsliv, jakt, fiske, reinsjakt, sm?viltjakt, ferieklubb, fjell, statsallmenning, hytteleie, hytter, fjellfiske">">
    <meta name="author" content="Sunndal Fjellstyre">

    it seems that is the section used by ‘wp_head()’ to add actions etc; i.e. this is likely influenced by something in the functions files.
    could be from some theme options, just with the wrong content entered…

    the section after the body tag is fine:

    <body class="blog">
    
    <div id="main">
    
    <header class="header">
    Thread Starter Datadama

    (@datadama)

    I removed an empty spaces in the header.php, between those meta-tags – and now the page looks fine. Not sure why, but … it’s friday.
    Thank you for all your help!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Removing "abandoned code"’ is closed to new replies.