With a nice long weekend, I decided to get some work done. Not real work but tidying up some lose ends on this blog.
The first one was to design an advert for my hosting company and a link to them:
Please click and join up as they are darn good value. Give you unlimited email addresses, sub-domains and mySQL databases for the price. Other’s will charge you a lot more and not give you as much!
The other two bits are with the Yoast WordPress SEO plugin [ Yoast ]. The first one was to add the breadcrumbs back into the site. It was put in, at the start, in a bad place so I decided to remove it. I went back to it when the latest version was released. It’s very simple to add as it tells you how to do it in the plugin. Just add the below lines to where you want the breadcrumbs to appear.
1 2 3 |
<?php if ( function_exists('yoast_breadcrumb') ) { yoast_breadcrumb('<p id="breadcrumbs">','</p>'); } ?> |
I had to add the below to the style.css file of the theme to make the output look pretty. It may work fine for you out of the box.
1 2 3 4 5 6 7 8 9 10 |
/* --- --- [ Yoast Breadcrumbs ] --- --- */ p#breadcrumbs { padding-top: 10px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; } strong.breadcrumb_last { font-weight: 600; } |
What I got is the below. Yes, there was one more change that I had to make but I’m sure you can figure out how to do that one.
The third is a little security tweak to the site. It hides the comment that displays the version number of the Yoast. This is to make the hacker’s job a little more tricky.
Your site should be running the latest version of the plugin, and WordPress as there is a major vulnerability in versions of Yoast up to 1.7.3.3
It’s easy to modify to add other plugins that do the same. Just add it to the theme’s funtion.php file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
add_action('get_header', 'rmyoast_ob_start'); add_action('wp_head', 'rmyoast_ob_end_flush', 100); function rmyoast_ob_start() { ob_start('remove_yoast'); } function rmyoast_ob_end_flush() { ob_end_flush(); } function remove_yoast($output) { if (defined('WPSEO_VERSION')) { $output = str_ireplace('<!-- This site is optimized with the Yoast WordPress SEO plugin v' . WPSEO_VERSION . ' - https://yoast.com/wordpress/plugins/seo/ -->', '', $output); $output = str_ireplace('<!-- / Yoast WordPress SEO plugin. -->', '', $output); } return $output; } |
Now check the website is still working as it should. It should be.
You may discover that the page’s <title> tag has disappeared. It did on this blog and it took me ages to figure out why. It’s quite a simple fix if it happens to you. Just find the below page in the plugin and make sure that the Force rewrite titles checkbox is unchecked. Simples!
If you’re still unsure what to do, the below image should help you out. This is taken from the latest version so if you don’t see it, then it maybe a good time to update your version.
I hope this has helped. Sometimes the simple things can help tighten up the security of your website.
