Google Plugins SEO

How to check for age ate the gate but always allow Google to crawl your website?

This title was kind of a big question we had to ask ourselves when building the website for a alcohol brand. Around the world, the Netherlands included, we try to discourage younger people to consume beverages with alcohol in them. So websites that sell things like that have to adjust their marketing campaigns accordingly. 

Google Crawlers

Stopping someone from entering your website is not that hard. Pop a message in place by throwing it in a hook that loads first and then create a cookie to confirm the user is eligible so the rest of the pages know that too.

In that message ask for some details, birthdate in this case. Calculate their age from that and compare it to the minimum age set for that website. This returns a yes or no. Pretty much the same thing a bouncer of a nightclub would do when checking ID’s of potential costumers.

Bam. Now you got yourself an age gate. But a Google crawler is not that smart that it has a fake ID in his pocket so how do you deal with that?

So the bouncer that works the nightclub door sees the crawler in the distance and nudges it to a separate door built for people with some sort of a vip access. Yes, when a crawler is looking at the website the age gate should not be visible to the crawler so it can go to work.

But what if the bouncer doesn’t see the crawler in time? Well, then there is the fact that the entire website is laced with schema and the age gate is loaded last zo it only covers the page so the things below are not visible instead of totally replacing it.

I’ve tested some other age gates and found them not to be that friendly to crawlers. That’s why I’ve decided to write my own Super Simple Age Gate.

Google Plugins SEO Wordpress

An attempt at using the  Google Site Kit WordPress Plugin 

Why didn’t I know about this? That is what I thought when reading about the release of Google Site Kit 1.0. Yes, Google has its own WordPress plugin called Site Kit. This allows users to show their analytics, speed test, search console and Adsense data right in their dashboards. I’ve installed it on one of my blogs and currently testing this tool. Since it’s by Google I am not that scared that this plugin is rather unsafe to use but you will never know. 

That said I dislike that my websites have those open api connections with all the Google Tools I use.  That’s why my sites have a minimum amount of plugins to work. And even then I still think there are way too many. Every outdated plugin or theme can do harm to your website and Google ranking. So, I view them as potential risks.

Not very well suited for website developers

With this Google Site Kit bundle there are some things that are slammed together in one piece of software. I like that thought so I installed the bundle and was not happy about what I saw. Google Site Kit seems like a dream come true for the average webmaster. You have to connect every plugin manually to your Google account. That makes sense.

But from a developer standpoint Google Site Kit doesn’t make any sense. There were barely any settings and the plugin to optimise your website. And any signals that tell you what Google does to your website are kind of absent. That should be something that I’d look for when installing a plugin like that. Some tools to help to get your SEO game going would be a nice asset coming from the Google camp.

Google Site Kit made my site slow as molasses

And then there is the weight of Google Site Kit. Running a speedtest via Google Lighthouse I got some awesome results without Google Site Kit. Running up in the green at around 98 percent. Not bad. Since it’s all about site speed at the moment I love that result. But with Google Site Kit running it plummeted to around 70-80 percent depending on the page. What the.. Google!

Google, what are you doing with my site?

All in all I wasn’t that impressed by this plugin. The lack of features and the modifications to your WordPress installation worried me a bit. And the speed dip on the front end was something that I didn’t expect from Google since they are rewarding websites for speed in search results. SEO wise it’s a bad choice. 

So after testing the plugin I quickly uninstalled Google Site Kit and added my own Google Analytics and Tag Manager plugin back to the WordPress installation.

Plugins Wordpress

Creating Plugins for WordPress

This was quite eye opener for me. For long I reckoned that creating a plugin was hard and labour intensive. Not to speak of the challenges that came up with WordPress in general. But the framework was there and it didn’t feel that difficult at all. I’m glad it all worked out.

For some of my own SEO/SEA projects, that merely serve as testbeds for theories, I needed some plugins to help me do the job. After searching for a while I kinda hated them all. That’s where my own plugins and Betacore happened. From one thing into another. You know how that goes.

Starting with a plugin

I used one-file plugins before in WordPress. To change things on the WordPress installation or a WordPress theme on a non-destructive way. So I already knew how to start with this:

A folder with the name of the plugin and a similarly named php file. In that file there have to be some comments to make WordPress recognise the entire thing.

* Plugin Name: The title of my plugin
* Plugin URI: the url to your plugin website
* Description: Something to describe your plugin
* Version: 6.66
* Author: Your name
* Author URI: your website

// start coding here!

Yes, it is that simple! A good file structure is important as well. So I’ve started with a basic /inc/ folder where all the php files with function sets would be housed. Every file has some functions that are kind of related. Some of them are sort of interchangeable so I can edit and update multiple plugins rather quickly.

Then there is the /templates/ and /css/ folders for all the things that make a plugin pretty. And in the end I get something along the lines like this:

// the folder
// in this file I include everything and ofcourse put the information displayed above.

// clean up after you are done
// some useful functions for editing and saving settings

// what it is all about, the meat of the plugin, the functionality basicly.

// all the navigational functions

// this is backend theme stuff

// this is frontend theme stuff

// the form page for the wp-admin side of the function

// the things that show on the frontend of WordPress.

That is about it.

Sanitising your form and outputted data

For making and keeping the data safe I trust the sanitisation functionalities of WordPress for now. However I am researching other possibilities as well. Double checking that the data inputted and outputted is limited to the information that should be put in the form as well ass the stuff that comes out the database is always a good practice.

Making use of the Uninstall.php

What I love about creating good plugins is that when everything is done and the day is over, when you want to delete the plugin, all the accompanying data is removed with it. Yes, cleaning up after yourself is good practice. Especially if your plugin is corrupting a WordPress installation you want to make sure nothing stays behind.

This is kind of how I go about creating the tools I need for the job and change my WordPress installation to fit my needs. Probably the next release will be a WordPress Janitor plugin that does some sweet stuff in the WP-admin panel like cleaning up those pesky widgets and keeping up with updates. I’ve also managed to tie a function into the cron so that you can receive an update every week on how the site is running and if there are things that need attention. The Super Simple Site Offline and Simple Analytics Tag tie in this plugin seamlessly and I made the thing feel like it belongs in the core WordPress. At least, I hope.