WordPress.org

Ready to get started?Download WordPress

Forums

How to change the homepage meta title? (5 posts)

  1. marcomancosu
    Member
    Posted 2 years ago #

    Hi,
    I'm having an issue with the meta title of my homepage. My website is
    http://www.ottimizzazione-pc.it/. I tried to modify the title using WordPress SEO and HeadSpace2 but none of them worked.
    I don't know why, but there are lots of repetitions in the title.
    The meta title should be: Corso di ottimizzazione del computer - introduzione | Corso di ottimizzazione del computer (that is: the title of the page and the site name, but I get:
    "Corso di ottimizzazione del computer - introduzione | Corso di ottimizzazione del computerCorso di ottimizzazione del computer | Impara ad ottimizzare il tuo computer", this includes: the title of the page, the site name repeated twice, followed by the "motto" of the site (sorry I use the Italian version of wordpress, I don't know how motto is translated in the English version - motto is modified in settings/general just below the site name).
    I'm a real beginner in wordpress, don't know anything about php and this is driving me crazy. Would you help me to fix it?
    Thanks

  2. marcomancosu
    Member
    Posted 2 years ago #

    Hi,

    I could fix it changing the code in the header.php.

    As suggested in http://wordpress.org/support/topic/homepage-meta-description-missing-title-doubled-on-google-search?replies=2

    I used:
    <title><?php wp_title(''); ?></title>

    to replace the previous text:
    <title><?php
    /*
    * Print the <title> tag based on what is being viewed.
    */
    global $page, $paged;

    wp_title( '|', true, 'right' );

    // Add the blog name.
    bloginfo( 'name' );

    // Add the blog description for the home/front page.
    $site_description = get_bloginfo( 'description', 'display' );
    if ( $site_description && ( is_home() || is_front_page() ) )
    echo " | $site_description";

    // Add a page number if necessary:
    if ( $paged >= 2 || $page >= 2 )
    echo ' | ' . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) );

    ?></title>

    and it worked.
    I don't actually know why my code in the header was different from
    <title><?php wp_title(''); ?></title>.
    It's likely I have messed it up while playing with other plugins, but anyway things are ok now.

  3. tumorambut
    Member
    Posted 2 years ago #

    nice share brother :D

    obat kuat

  4. digitalartempire
    Member
    Posted 2 years ago #

    i think that changes it for every page - so your posts and pages wont have unique meta titles

  5. jbsxpo
    Member
    Posted 2 years ago #

    Thanks For your suggestion I need it because I am new use wordpress it's very helpful for me..

    Obat Kuat

Topic Closed

This topic has been closed to new replies.

About this Topic