Blog

Cannot redeclare yoast_breadcrumb() – WordPress Error

Cannot redeclare yoast_breadcrumb() – WordPress Error

NOTE: Each problem is unique. This was one solution, you can try it and move on to another possible solution if it does not work.

DATE OF PROBLEM: Jan 22, 2015

OPERATING:
Windows 7 Computer
WordPress
Unique Custom WordPress Theme called HotelBooking
No antivirus other than Microsoft Essentials

PROBLEM:
Once WordPress SEO by Yoast is Activated as a Plugin the following error occurs.
* Fatal error: Cannot redeclare yoast_breadcrumb() (previously declared in /home/{YOUR WEBSITE]/wp-content/plugins/wordpress-seo/inc/wpseo-functions.php:108) in /home/{YOUR WEBSITE}/wp-content/themes/HotelBooking/admin/breadcrumbs/yoast-breadcrumbs.php on line 340
* The entire WordPress site and Dashboard is shut down.

SOLUTION:
STEP 1 – Go into site via FTP (I use Filezilla) and go to the {YOUR WEBSITE}/wp-content/plugins/wordpress-seo and change the plugin directory name to wordpress-seo-OLD
STEP 2 – Now go into your WordPress Dashboard and go to the file where the problem is. In my case it is “/HotelBooking/admin/breadcrumbs/yoast-breadcrumbs.php”. I am going to change the “breadcrumbs” directory to “breadcrumbs-OLD”.
STEP 3 – Now go back and rename the {YOUR WEBSITE}/wp-content/plugins/wordpress-seo-OLD back to wordpress-seo. Refresh your site and you will most likely see some more errors.
STEP 4 – Look at these errors. Most likey they will show a file in your theme that is trying to use WordPress SEO. In my case the file was /{YOUR WEBSITE}/wp-content/themes/HotelBooking/admin/admin_main.php. I downloaded this file to my desktop using Filezilla.
STEP 5 – Using Notepad++ (great PHP editing program) I
changed the line to block it from being used
include_once (TT_ADMIN_FOLDER_PATH . ‘breadcrumbs/yoast-breadcrumbs.php’); //BREAD CRUMS RELATED FILE FOR FRONT END
to
//include_once (TT_ADMIN_FOLDER_PATH . ‘breadcrumbs/yoast-breadcrumbs.php’); //BREAD CRUMS RELATED FILE FOR FRONT END
STEP 6 – Brought the changed file back to the /{YOUR WEBSITE}/wp-content/themes/HotelBooking/ directory (the older admin_main.php one was save with a -OLD on the end of it).
PROBLEM FIXED
HOWEVER…IMPORTANT: I just wanted to get the site up and going again. I am not sure how I have affected the WordPress SEO by Yoast plugin’s effectiveness.

THE SOLUTIONS THAT DID NOT WORK:
1) Trying to deactivate the WordPress SEO by Yoast plugin once the error occurred.
2) Renaming the entire directory of “/HotelBooking/admin/breadcrumbs/” to “/HotelBooking/admin/breadcrumbs-OLD/”

WORKAROUNDS IF YOU ARE IN A PINCH:
1) Just disable the WordPress SEO by Yoast Plugin STEP 1 until you have time to deal with the problem.

OTHER SUPPORTING WEBPAGES:
http://kb.yoast.com/article/97-cannot-redeclare-yoast_breadcrumb-error

Written by

Garrett Hall is an online marketing & development expert with eosFirst AuroraCon. eosFirst is a website design, online development, online marketing and information technology consultancy.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.