According to Yoast, breadcrumbs are a good way to rank higher in search engines. I mostly like them because they provide easy navigation around the site. I use Yoast’s SEO plugin on the site, which provides easy breadcrumbs. You basically just have to drop the following PHP code into your page templates:

<?php if ( function_exists('yoast_breadcrumb') ) {<br /> &nbsp;&nbsp;&nbsp;yoast_breadcrumb('<p id="breadcrumbs">','</p>');<br /> } ?>


The current theme used on my site is Roots. To insert the breadcrumbs, I put the code above right under
<div id="main" class="<?php echo MAIN_CLASSES; ?>"

in the following pages:

  • Main Index Template (index.php)
  • Custom Page Template (page-custom.php)
  • Page Template (page.php)
  • Single Post (single.php)

I left the breadcrumbs off the front page, but to enable them just add the code to front-page.php. I’m not an expert in WordPress, so if there’s an easier way to do this, I’d love to hear it in the comments.