Yoast and Standard theme: Fatal error
-
Hi all-
A client has tried installing Yoast on her site and received at fatal error (below). She's been able to restore her site and get it functioning again, but I'm wondering if there's a work around so we can use the plugin. It's a Wordpress site using the Standard Theme.
I've searched the forums (and here!) and haven't found anything helpful yet. Do you have any suggestions?
Thanks!
"Fatal error: Cannot redeclare yoast_breadcrumb() (previously declared in /vservers/nwconstructi/htdocs/NWCL/wp-content/plugins/wordpress-seo/inc/wpseo-functions.php:108) in /vservers/nwconstructi/htdocs/NWCL/wp-content/themes/StandardTheme_272/lib/standard_yoast_breadcrumbs.php on line 280"
-
Thanks for your research Kevin. I saw the same thing. Was looking for work-arounds actually.
-
Thanks.
-
Hi,
It's not a big job to implement, best practice is to use a child theme however you could hook it in the theme functions file.
-
Hi DeanAndrews.
Thanks for your response.
The client has renamed the offending wordpress-seo plugin directory to wordpress-seo-old and that restored the site immediately. Can we just leave it that way, reactivate the plugin, and move forward from there or will other problems arise?
If we "wrap the class and functions" as you suggest, is it a large effort? Will it impede our upgrade ability should the Standard Theme release an upgrade?
Just trying to understand all our options and am very appreciative of your help.
D
-
From Yoast KB:
If you're getting an error that looks like this:
Cannot redeclare yoast_breadcrumb() (previously declared in /hom/require/public_html/wp-content/plugins/wordpress-seo/inc/wpseo-functions.php:96) in <path></path>
Your theme or another plugin is including our breadcrumbs class, and not properly wrapping it in
class_exists
orfunction_exists
wrappers. The <path>part of the error above should normally point you at either a themes or plugins directory, telling you which plugin is the culprit.</path>The breadcrumbs class in our plugin is maintained, whereas the breadcrumbs class shipping with your theme is probably out of date. So check with the creator of your theme and send them to this page.
You should wrap the class and functions in
class_exists
orfunction_exists
wrappers. Or, even better, you shouldn't include it at all and just tell people to install our WordPress SEO plugin and use the breadcrumbs provided by our plugin as those are far more up to date and actually work with custom post types, custom post type archives, etc.Source: http://kb.yoast.com/article/97-cannot-redeclare-yoast_breadcrumb-error
-
Do you have the plugin Wordpress SEO installed? Possible explanation from a user at stackoverflow:
"You have the plugin Wordpress SEO installed which has breadcrumbs included. It looks like you cannot install the breadcrumb plugin also. Use the breadcrumb feature included in Wordpress SEO plugin."
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Change theme or domain first?
I bought a new domain and I want to use it instead of my current domain for my website. I also want to change my theme. Which should I do first? At the time I have my new domain forwarded to my current domain.
Technical SEO | | tfuentez0 -
Yoast and wordpress duplicate meta
I'm using the Yoast plugin with wordpress and have noticed in my HTML I have duplicate meta data. For example my header starts with
Technical SEO | | simonatkinsphoto
<title>(title) </title<span><<br /><meta </span><span class="html-attribute-name">property</span><span>="</span><span class="html-attribute-value">og:site_name</span><span>" </span><span class="html-attribute-name">content</span><span>=<br /><span><meta </span><span class="html-attribute-name">property</span><span>="</span><span class="html-attribute-value">og:description</span><span>" </span><span class="html-attribute-name">content</span><span>=<br /><br /></span></span>Then I have the 'This site is optimised by Yoast" tagline followed by the same meta -<br /> <span><meta </span><span class="html-attribute-name">name</span><span>="</span><span class="html-attribute-value">description</span><span>" </span><span class="html-attribute-name">content=<br /><span> <meta </span><span class="html-attribute-name">property</span><span>="</span><span class="html-attribute-value">og:title</span><span>" content=<br /><span> <meta </span><span class="html-attribute-name">property</span><span>="</span><span class="html-attribute-value">og:description</span><span>" </span><span class="html-attribute-name">content=<br /><span> <meta </span><span class="html-attribute-name">property</span><span>="</span><span class="html-attribute-value">og:site_name</span><span>" </span><span class="html-attribute-name">content</span><span>=<br /><br /></span></span></span></span>Is this likely to cause problems with Google and is there a way to stop both wordpress and Yoast adding meta to the header. </p></title>0 -
Duplicate title error in GWT over spelling in URL
Hi, How do I resolve a duplicate title error in GWT over spelling in URL? Ttile of Post: Minneapolis Median Home Sales Price Up 16 Percent Not sure how this happened, but I have two URL versions show up. Even with a 301 redirect, the both remain an error in GWT. /real-estate-blog/Minneapolis-median-home-sales-price-up-16-percent and /real-estate-blog/minneapolis-median-home-sales-price-up-16-percent
Technical SEO | | jessential0 -
Is anyone able to check this 301 redirect for errors please?
Hi, I had a developer write a 301 wildcard for redirecting old hosted site to a new domain. Old URLS looked like /b/2039566/1/akai.html
Technical SEO | | Paul_MC
With varying letters & numbers. I have 26,000 crawl errors in GWT and I can only imagine it's because this is looping?
Can anyone advise if this would be causing grief? Thanks
Paul RewriteCond %{HTTP_HOST} ^vacuumdirect.com.au$ [OR]
RewriteCond %{HTTP_HOST} ^www.vacuumdirect.com.au$
RewriteRule ^/?$ "http://www.vacuumbag.net.au/vacuum-cleaners.html" [R=301,L] <ifmodule mod_rewrite.c="">RewriteEngine On
RewriteBase /
RewriteRule ^p/([0-9]+)/(.*) default/$2 [R=301,L]</ifmodule> <ifmodule mod_rewrite.c="">RewriteEngine On
RewriteBase /
RewriteRule ^c/([0-9]+)/1/(.*) default/vacuum-bags/vacuum-cleaner-bags-$2 [R=301,L]</ifmodule> <ifmodule mod_rewrite.c="">RewriteEngine On
RewriteBase /
RewriteRule ^p/([0-9]+)/(.*) $2 [R=301,L]</ifmodule> <ifmodule mod_rewrite.c="">RewriteEngine On
RewriteBase /
RewriteRule ^c/([0-9]+)/(.*) default/$2 [R=301,L]</ifmodule>0 -
Fixing a wordpress 404 error for /feed and /comments/feed?
I have a wordpress site that does not have a blog currently. I'm getting a 404 for /feed and /comments/feed. Anyone know how I can fix?
Technical SEO | | DM50 -
Thousands of 503 Errors
I was just checking Google Webmaster Tools for one of the first times (I know this should have been a regular habit). I noticed that on Feb 8th we had almost 80K errors of type 503. This is obviously very alarming because as far as I know our site was up and available that whole day. This makes me wonder if there is a firewall issue or something else that I'm not aware of. Any ideas for the best way to determine what's causing this? Thanks, Chris
Technical SEO | | osports0 -
404 Errors
Hello Team, I noticed that my site has 1,000s of 404 errors. Not sure how this happened, maybe when I updated our CMS. My question is, should I worry about them. Should I delete them or just leave them alone. Thank you for your feedback!
Technical SEO | | Dallas0 -
Wordpress SEO Errors - Any advice?
Hi all! My site is on the WP platform and I'm having a crawl error. Wondering if you guys could possibly help me figure out what's going on? I have a good number of 404 errors where the links seems to be appended and I can't figure out why. I've scoured my individual posts and cannot seem to find the broken link? The crawl error looks a bit like this: http://preciousthingsphotography.com/2007/12/10/chicago-family-photographer-welcome/http:%2F%2Fpreciousthingsphotography.com%2F2007%2F12%2F10%2Fchicago-family-photographer-welcome%2F You can see that my original link is somehow being doubled with the slashes being replaced? This is happening on all of my posts. Any ideas as to what could be going on? Thanks so much!
Technical SEO | | ptpgen0