Error: Cannot redeclare yoast_breadcrumb()

If you’re getting an error that looks like this:

Cannot redeclare yoast_breadcrumb() (previously declared in /home/require/public_html/wp-content/plugins/wordpress-seo/inc/wpseo-functions.php:96) in <path>

Your theme or another plugin is including our breadcrumbs class, and not properly wrapping it in class_exists or function_exists wrappers. The <path> part of the error above should normally point you at either a themes or plugins directory, telling you which plugin or theme is the culprit.

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.

I created the theme, what should I do to fix this error?

You should wrap the class and functions in class_exists or function_exists wrappers. Or, even better, you shouldn’t include it at all and just tell people to install our Yoast 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.

Related articles

Get free SEO tips!