Search results

  1. S

    PHP function to remove whitespace & comments (Minify HTML)

    Use this handy PHP function to remove all whitespace in HTML pages, effectively minifying the HTML page. This will shave off a few kb's on large HTML pages rendered using PHP. function sanitize_output($buffer) { $search = array( '/\>[^\S ]+/s', // strip whitespaces after tags...
  2. S

    Custom Page Titles & Meta Descriptions for Xenforo 2

    Define custom page titles and meta descriptions without the aid of using addiitional addons and plugins. Use the below method to set custom SEO friendly page titles and meta descriptions on any page type or node. Locate your page_container in the Xenforo ACP, replace the code for rendering the...
  3. S

    Structured Data (Schema) for Xenforo

    Below is how I crafted the schema breadcrumbs path and the WebPage schema for Xenforo 2. Add this to the head section of your PAGE_CONTAINER template file. This works great for Xenforo pages, for some reason the developers left out structured data for pages. JSON snippet for breadcrumbs...
  4. S

    PHP variable to deploy canonical tag (self-referencing)

    Use this PHP variable snippet to deploy a self-referencing canonical tag to your PHP (semi dynamic & dynamic) powered website. Add the following to your head section <?php $canonical="https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; echo "<link rel='canonical' href=$canonical>" . "\n"; ?>...
  5. S

    PHP Conditional to noindex Matched URL

    A simple quick and easy solution to deploy a noindex tag on specific matching URLs or parameters using a PHP If conditional. This will be useful if you have limted to no access to amend the robots.txt or you're looking at building a conditional logic for keeping URLs out of Google's Index. Such...
  6. S

    JavaScript (JS) Delay Execution 3rd Party Scripts

    Improve your Google Pagespeed Insights score by delaying the execution of below the fold third-party functionality such as commenting scripts, help bots, reCAPTCHA, Share This, Cookie Scripts and more. Async and Defer can really make a massive difference in improving Pagespeed Insights score...
  7. S

    Improved SEO for MyBB Forum

    Do you use myBB forum script? I have a quick and easy way to improve your forum SEO. Out of the box, myBB is a great way to create and build a community on your website. myBB is a free open source PHP/MySQL forum script. I have used myBB on a few websites over the years it’s a great way to...
  8. S

    Shopify fix Invalid enum value in field "availability" Schema

    How to fix the Shopify Invalid enum value in field "availability" Schema error in Google Search Console and the structured data testing tool. Find the following line in the product schema snippet: "availability": {%- if product.available -%}"//schema.org/InStock"{%- else...
  9. S

    Enforce trailing slash htaccess directive

    For SEO reasons or aesthetic reasons, if you are looking to enforce the trailing / forward-slash at the end of the URL (URI) the below method is an easy solution to achieve the 'enforced trailing slash htaccess directive'. Add the directive below to your htaccess file anywhere below the...
  10. S

    PHP echo URL for Canonical Tag & OG Tag

    Save time on manually populating canonical tags and open-graph (OG) using a simple PHP snippet. This method will fetch the current URL loaded in the browser. Replace your canonical and OG tag with the following: <!-- canonical tag --> <link rel="canonical" href="<?php...
  11. S

    How to call the WordPress header outside the loop (embed plugins & shortcodes)

    Easy to follow guide (allow a few hours for first instance) to use WordPress PHP shortcodes outside of the WordPress loop environment. This will allow you to modify a static web page (or sidewide) to call in dynamic functionality provided by popular WordPress plugins. This guide assumes that...
  12. S

    How to force redirect www URLs to non-www

    To redirect all www. requests to non-www, add the following directive early on in your .htaccess file. This will force any www. requests to use non-www. using an SEO friendly 301 redirect. RewriteEngine On RewriteCond %{HTTP_HOST} ^www.domain.com [NC] RewriteRule ^(.*)$ https://domain.com/$1...
  13. S

    Domain migration & site refresh

    Over the coming weeks, I shall be refreshing the content and pages on the Sitebee website. Additionally, I will be migrating away from .co.uk to .net to reach a wider global audience. You may have also noticed that I have dropped WordPress and switched to Xenforo. Xenforo is better, faster and...
  14. S

    Single redirect hop http to https & non-www to www (htaccess)

    Here is the solution to set a single redirect hop for http to https & non-www to www using a mode_rewrite htaccess directive. This is useful for removing the redirect chain often caused by http & non-www requests. Typically if a request non-ssl non-www is made, the first hop is forced ssl, then...
  15. S

    Redirect a parked (alias) domain via htaccess (domain migration)

    Here is the htaccess directive required to set a wildcard redirect on a parked (alias) domain. Useful for domain migrations or multiple parked domains on web hosting account/server. It also uses the SEO friendly 301 redirect. Add the following to the htaccess file. RewriteEngine On RewriteCond...
  16. S

    HREFLANG Tags for Xenforo

    If you are running the Xenforo forum community script and looking to implement hreflang tags, here is the solution. This is based on using separate ccTLD domains. Log in to the administrator area, head to templates > page container. In the DOM head section, paste the following: <!--...
  17. S

    Run Screaming Frog in the Cloud (Windows VPS)

    If you’re honing your technical SEO skills and finding that tools such as Screaming Frog are taking too long to complete the crawl. Or the resource requirement is hogging down your computer! Why don’t you invest in a budget Window Server VPS? Seriously, if you have a paid license of Screaming...
  18. S

    Domain Migrations & Replatforming

    If you’re looking to undertake a domain migration or a replatforming migration or even both, then this post might be of some use to you. I’m going to put some thoughts to paper on some of the migration work I have collaborated on in recent months… I’m not going to name business names or...
  19. S

    Disqus Comments is slowing down your website

    Disqus is a very popular social commenting system used by over 600 thousand websites (Source: BuiltWith). Today I found out that Disqus for WordPress is having a negative impact on my website’s performance (page speed on both desktop and mobile) specifically on blog posts that could outway the...
  20. S

    How to find Cannibalising Keywords & URLs with Search Console

    Are you having problems with keyword cannibalisation in organic search your marketing efforts? Keyword cannibalisation is when two or more different URLs (pages) fight it out against each other for the highest organic position on the exact same search term. Here is a handy easy to follow...