Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Remove meta description?

According to Google, it's better to have no description than a duplicate., so I am trying to remove the meta description from paginated pages.

I know you can edit the description with $sender->Head->addTag('meta'... but how can I completely remove it? I don't want an empty description, I want no description tag on the page at all. Is this possible? Is there a reverse to Head->addTag?

Comments

  • x00x00 MVP
    edited August 2015

    https://support.google.com/webmasters/answer/35624?hl=en#1

    It is nothing to do with SEO which meta description has nothing to do with these days. It is just they may not display the boiler plate on searches. I wouldn't worry.

    grep is your friend.

  • Is there a reverse to Head->addTag?

      /**
           * Removes any tags with the specified $Tag, $Property, and $Value.
           *
           * Only $Tag is required.
           *
           * @param string The name of the tag to remove from the head.  ie. "link"
           * @param string Any property to search for in the tag.
           *    - If this is an array then it will be treated as a query of attribute/value pairs to match against.
           * @param string Any value to search for in the specified property.
           */
          public function ClearTag($Tag, $Property = '', $Value = '') {
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Thank you. I'm not sure I'm using it correctly though. I tried both of these, and neither worked, am I missing something?

    $sender->Head->ClearTag('meta');

    and

    $sender->Head->ClearTag('meta', 'description');

    Thanks for the help!

  • If you don't want to adhere to x00's suggestion and you want to know mechanics.

    this should help you with your experimentation.

    here is an example of an addTag with a meta and description. Should be a similar way through ClearTag.

     $this->AddTag('meta', array('name' => 'description', 'property' => 'og:description', 'itemprop' => 'description', 'content' => $Description));
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • where are you putting the code?

    grep is your friend.

  • In a custom plugin in this function:
    public function discussionsController_render_before($sender)

  • you would need to use the beforeToString hook, as the head module is during render.

    However there is a better way.

    in your hook do $sender->description(false);

    grep is your friend.

  • You could have also added a meta tag to tell search engines to ignore the description. Either way this does very little.

    grep is your friend.

  • $sender->description(true, '');
    

    should work

    grep is your friend.

  • @almostbasic: Where did you read that Google recommends empty descriptions?

    I read this here:

    Programmatically generate descriptions. For some sites, like news media sources, generating an accurate and unique description for each page is easy: since each article is hand-written, it takes minimal effort to also add a one-sentence description. For larger database-driven sites, like product aggregators, hand-written descriptions can be impossible. In the latter case, however, programmatic generation of the descriptions can be appropriate and are encouraged. Good descriptions are human-readable and diverse, as we talked about in the first point above. The page-specific data we mentioned in the second point is a good candidate for programmatic generation. Keep in mind that meta descriptions comprised of long strings of keywords don't give users a clear idea of the page's content, and are less likely to be displayed in place of a regular snippet.

    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
Sign In or Register to comment.