• When I type keywords in search engines, the following appear in the search results which happen to be my posts. How do I remove them and place instead the title of my posts? My website is https://brightlight-thoughts.com. Please help me.

    %post-title% | %blog-title%
    25 May 2010 … Untouched by human hands! Mr. David Wolfe’s Sunfood Nutrition includes the best organic Goji berries, grown in protected Chinese valleys. …
    brightlight-thoughts.com/…/the-nutritional-wonders-of-raw-food-3/ – Cached

    %post-title% | %blog-title%
    25 May 2010 … Tags: biggerbooks sale, Carol Burnett, Dead in the Family, Laura Bush new book; New York Times Top Ten Bestsellers, Queen Rania’s book …
    brightlight-thoughts.com/…/new-york-times-top-bestsellers-at-biggerbooks-com/ – Cached

Viewing 2 replies - 1 through 2 (of 2 total)
  • You’ve got nonsense within your <title></title> elements at the top of each page.

    For your index.php you could use

    <title> <?php bloginfo('name'); ?> <?php bloginfo('description'); ?></title>

    For your category.php you could use

    <title><?php echo category_description(); ?></title>

    For your single.php you could use

    <title>
    <?php $title = get_post_meta($post->ID, "title", true);
    if ($title !=='') {echo "$title";}  ?>
    </title>
    
    <meta name="description"
    content="<?php  $meta_description = get_post_meta($post->ID, "meta-description", true);
    if ($meta_description !=='')
    {echo "$meta_description";} ?>" />

    You’ll need to create custom fields called ‘title’ and ‘meta-description’ for the single.php

    (From my notes)
    Both the title and the meta description use Custom Fields. Custom Fields are a way of adding extra information to a post (single.php) or Page (page.php) and then pulling out that information and displaying it in useful ways. In this case Custom Fields are used for the title element and the meta description, which is far more robust than relying on plugins.

    In the Admin Panel / Pages / Add New you’ll find the text Custom Fields immediately below the big box where you enter your text, images etc. for your post.
    Click Enter New
    In the Name box type in the word title
    In the Value box type in the title for that post e.g. Strawberries are great!
    Click Add Custom Field
    From now on there will always be a dropdown box below every post and every Page, and you can select title from that dropdown box. In the Value box you can then enter information that you want displayed between the title elements <title></title> for that post or Page e.g. Strawberries are great!.

    For the meta desciption follow the same steps as above, but in the Name box type in meta-description

    Thread Starter efal

    (@efal)

    richarduk, you’re great! Thank you very much. I printed your instructions and tried it on single.php. I’ll try doing it on my categories next time. I appreciate the help. Thanks again.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Why are these signs ( %post-title% | %blog-title%) appear in my post titles?’ is closed to new replies.