WordPress.org

Forums

Yoast SEO
[Plugin: WordPress SEO by Yoast] Your theme contains a meta description, which blocks WordPress SEO (15 posts)

  1. gmorris33
    Member
    Posted 2 years ago #

    Hi

    I am sure that this has been answered before but cant find it.

    I am getting this message on the main WordPress SEO page "Your theme contains a meta description, which blocks WordPress SEO from working properly, please delete the following line, or press fix it:" - "<meta name="description" content="<?php echo get_post_meta($post->ID, 'gp_page_description', true); ?>" />"

    It then has a button to fix it but nothing happens? I have looked for the code but cant find it to change it. Where can I fix this or change it in the theme?

    Thank for your help

    Glen

    http://wordpress.org/extend/plugins/wordpress-seo/

  2. Sean O'Dwyer
    Member
    Posted 2 years ago #

    Also getting this error. Have grepped through the theme files and meta description is definitely not included...

  3. tzeldin88
    Member
    Posted 2 years ago #

    Same. My theme does NOT have a meta-description, but this plugin keeps throwing this warning incorrectly.

  4. jrf
    Member
    Posted 2 years ago #

    Which theme are you using ?

  5. tzeldin88
    Member
    Posted 2 years ago #

    I write my own custom themes, built on underscores.me, and i know i didn't have a meta-description tag in the template. I did have one in commented-out php, but i even deleted that entirely and the plugin still showed the warning. Eventually i just clicked the "fix it" button in the warning, and that worked -- but i didn't like that idea since i didn't (and still don't) know exactly how the plugin was going to "fix" a problem that doesn't actually exist.

  6. jrf
    Member
    Posted 2 years ago #

    @tzeldin88 You could've just had a peek at the plugin source ;-)

    The plugin looks in the theme's header.php file for a meta tag line with the name "description". It will warn you if it finds it. If you click "fix it", it will make a backup of the file and remove the line.
    If it does not find the line anymore, all that happens is the backup.

    I guess it detected the line even though it was commented out.

  7. tzeldin88
    Member
    Posted 2 years ago #

    Hmm. But as i said, i had removed the line myself from header.php, but the warning persisted. I also found others talking about this issue, and some suggested the browser cache was involved (http://wordpress.org/support/topic/your-theme-contains-a-meta-description-1?replies=6), but that didn't fix it for me either. I had to click the "fix it" button, though as i said, i had already deleted the commented-out meta-desc from header.php myself. Weird.

  8. jrf
    Member
    Posted 2 years ago #

    @tzeldin88 You make a fair point, it was kind of weird. So I thought I'd make a "re-check theme" button so you could 'force' WP SEO to re-check the theme if you manually removed it.

    Anyways, 8 hours later, I've re-written nearly all the code related to this check. I found (and fixed) a number of bugs, most notably that the plugin was always checking in the header.php file of the *parent* theme, even if a child theme was used. Similarly, the "Fix it" button would remove the line from the parent theme, not the child theme.
    Also, the "Fix it" action would fail if it had been used before.

    I've submitted my changes in a pull request and I kind of expect the changes will be released in the next version of the plugin.

    Happy ?

    Smile,
    Juliette

  9. xhoun
    Member
    Posted 2 years ago #

    hi, I am having the same issue "Your theme contains a meta description, which blocks WordPress SEO from working properly, please delete the following line, or press fix it:.

    Any help is appreciated.

  10. jrf
    Member
    Posted 2 years ago #

    @xhoun, please read what I've written right above you.... ;-)

  11. xhoun
    Member
    Posted 2 years ago #

    my bad, hehe will wait for the next version of the plugin :)

  12. tzeldin88
    Member
    Posted 2 years ago #

    @jrf -- Wow, fantastic!!! Yes very happy ;) I really do appreciate your looking into this, and so quickly.. and of course your efforts to improve the plugin for everyone.

  13. jrf
    Member
    Posted 2 years ago #

    @tzeldin88 Thanks for your positive reaction. Nice to feel appreciated ;-)
    The way I look at it is: I can spend energy being frustrated with things which don't work or I can spend that same energy fixing it. I guess you know which choice I made.
    Now let's inspire more people to do the same ;-)

    @gmorris33 if you are reading this - do you agree that what I've done now solves this ? If so, please mark the topic as resolved.

  14. Mike
    Member
    Posted 1 year ago #

    I also noticed the warning persisting after manually deleting the line in header.php. One would think the plugin would check again when you refresh the wpseo_dashboard page, but apparently not? I also can't get the "Fix it" button to work, even if I change file permissions to 777.

    Warning: fopen(/home/user/public_html/test/wp-content/themes/themename/header.php.wpseobak) [function.fopen]: failed to open stream: Permission denied in /home/user/public_html/test/wp-content/plugins/wordpress-seo/admin/pages/dashboard.php on line 64

    Anyway, thanks @jrf, hope to see your fix in the next version.

  15. jrf
    Member
    Posted 1 year ago #

    I've merged the fix with the WP SEO core after a heads-up from @yoast, so it will be included in the next version (which I kind of expect to be released pretty soon).

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Yoast SEO
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.