Getting AdSense by Google working

An introduction

Getting Google AdSense working was a bit of a trial. I have no experience with it and only limited experience with WordPress. It seems like a recipe for endless frustration and just giving up. But it wasn’t all that hard. Frustrating, yes, but dear reader, it is doable and in the end quite easily.

There are a number of things that need to be done before you even start so let’s hop to it.

First steps.

Before you even start it’s a good idea to decide whether or not you really, really want or need advertising on your web site. If you are thinking of making buckets of money out of it then I’d suggest that advertising is not the way to go unless you have thousands of hits per day. This site is a low traffic site so it makes very little revenue – Google AdSense is more of an experiment driven by curiosity.

If the answer is a resounding yes, then a decision is to be made. Do you want to have static adverts placed by yourself on the web site or do you want Google AdSense to feed you the adverts. If you wish to place the static adverts yourself then you’ll have to design them, market them, etc. All that is well beyond the scope of this post. If you’re happy to display the adverts served up by Google then read on.

Next thing is to get a domain name. I purchased from NoIP and set up my home NBN, or ADSL,  router to communicate with NoIP and do the DNS thing. It was easy and very cheap but I am hosting this site at home on my own hardware.

The next step is to get a web server happening. How I did it is here. Although I used WordPress there are many other ways of doing it. This post is reqally only relevant to WordPress users.

Once you get it going and you can access it from the outside world you can carry on with the rest, starting with some sort of search engine optimisation (SEO). I use the free edition of Rank Math after a couple of brief affairs with other SEO plugins. Don’t worry about content yet though.

Now it’s time to create a Google AdSense account. Once you fill in all the details you’ll experience a bit of a wait for it to get approved. Google likes to see web sites that are active which is why we didn’t add content yet.

This is when you put a lot of effort into creating content. Google will see that the web site is being updated a lot and their algorithm will shorten the approval process. I’ve heard of sites taking a couple of weeks but this site only took a couple of days.

Once you’ve been approved the fun really starts.

Next steps

We’re now at the point where the actual adverts can be created by Google for you. Log into your AdSense account and go to “Ad Units” and from there create the adverts. I have three “responsive” “Display” adverts. I’ve called them “jandmf_top”, “jandmf_bottom” and “jandmf_sidebar” to reflect where they’ll be placed. Don’t worry about the code snippet yet though.

I use a couple of WordPress plugins to make life a bit easier. “Insert Headers and Footers”, “Page Builder by SiteOrigin” and “Site Origin Widgets Bundle”.

The advert at the top is in the “Header Section” of the “Insert Headers and Footers” plugin. All I did was put a “<div align=”center”>” and “</div>” around the code snippet from Goodle Adsense for “jandmf_top”.

For the side bar and bottom adverts I did the same for “jandmf_sidebar” and “jandmf_bottom” code snippets except the code snippet was pasted into the relevant widgets from the Widgets Bundle.

What I’ve said is probably not at all clear at this stage. You’ll be well served by reading the help on the Google AdSense site. The WordPress help and the documentation for the plugins is a big help too. Experimentation is also very useful. Once you get it going it’s almost set and forget and you’ll start to see adverts.

A few other tips and tricks.

One big, huge tip is do not click on your own adverts. Google does not like that even a little bit and it can be a shortcut to being banned from AdSense so don’t do it.

Before I started using the plugins I experimented with another couple of plugins that are specifically designed to place AdSense adverts but I couldn’t get the result I wanted so I scrapped them in favour of this much easier method.

Another method I used was to use a WordPress child theme. Again, I just couldn’t get the result I wanted. I tried to have the AdSense ads presented at half the vertical size that they currently are but after days of messing around I gave up on that idea. I now only use a child theme for the copy write information at the bottom of every page.

The WordPress them that I use is Twenty Sixteen so what I’ve described may well be a lot different for other themes but I think that the general principles remain the same.

I think if you just let AdSense place the adverts it totally wrecks the look and feel of the site and makes it disjointed with adverts appearing throughout each page which looks to me to be a good reason to loose interest in the content and go and read another site.

By no means am I an expert with AdSense but after days and days of messing about I reckon I’ve got the adverts presented where I want them without messing up the whole site.

Have I made any money out of the adverts ? Well, the answer is bugger all. I have though, gained a bit of insight into how web advertising works as well as a lot more knowledge about WordPress.

As ever, comments and criticisms are welcome.


Coming to grips with Rank Math

Rank Math

In a previous post I mentioned Yoast and that I had it working. Well I sort of did but I found it to be not really to my liking. Whilst idly reading posts in a Google Analytics Facebook group I stumbled a post about the Rank Math SEO plugin so I thought I’d do a bit more reading and see what the go is. I liked what I saw so I went ahead and got rid of Yoast and downloaded and installed the Rank Math plugin. It seemed a lot easier and less cryptic to me so I decided to go for broke with it. Configuring it was a breeze and soon I had it telling me what I should do to this site to enhance my search results.

I still had one problem though. Sitemaps. The I read something on the Rank Math web site about Googles new Indexing API and of course I just had to try it out didn’t I. Goodbye sitemap issues.

I just followed the Rank Math instructions and it all worked OK apart from a couple of user errors that were easily fixed by re-reading the documentation and carefully following it.

Since installing the Rank Math and the Instant Indexing plugins a few hours ago I’ve already had this site indexed and there are results already apparent in the google search results. Now I have to go through all my posts and pages and follow the advice that’s in the Rank Math documentation regarding improving the sites SEO. This’ll keep me occupied for a while. With the COVID-19 lock down still in force time is something I have an excess of so I may as well make use of some of it playing around here.

More WordPress wrangling

The start of it all

When I started this whole LAMP + WordPress thing I just leapt straight in. I had the content under which meant that I needed to have a redirect in my .htaccess. I also skipped SSL – I was impatient and just wanted the thing up and running. I already had a strategy to move the content from where it was and I already had WordPress sorted out – to a degree.

Anyway I got the web site up and running well but without SSL. It transpires that search engines really, really like to see SSL and without it your search engine results can suffer. Because I’m using Google AdSense  to place advertisements I wanted good search engine results.

So now I had three tasks. Install SSL, move the content from “” to “” and to find a decent Search Engine Optimisation plugin for WordPress.

Getting SSL happening

Getting SSL happening was the task I chose to do first. How hard can it be ? There’s a heap of HOWTO’s online. Some of them are really cryptic and others are long winded but straight forward. Then I found Certbot. I just followed the instructions and it installed perfectly. Only problem is that Jenny’s site worked perfectly but the WordPress part didn’t. I ended up messing around with my WordPress configuration a lot in an effort to get it working. On more than one occasion I needed to restore my backup to get it working again. This palava went on for a couple weeks until I moved the WordPress site to where it should be. Once I moved the WordPress part of the site  to “” it all fell together. There were a few references to “http://” in the site and database but it just so happens there is a handy search and replace plugin. This was duly downloaded and installed and run. The configuration needed a bit of tweaking too but after a bit of messing around it all now works perfectly.

There may be a few stray references to “http:/” in the site but I’ll stumble across them sooner or later and fix them. Embedded Google Maps is a bit of a problem as they all start with “http://” but I’ll fix them as I go. There’s only about five or six of them so that’s an easy job.

Moving WordPress

The next effort , in conjunction with SSL, was to move WordPress from “” to “”. The thought of doing this filled me with all sorts of trepidation.

After trying to work out some sort of scheme I decided to backup the site as it was and then simply move the contents of “/var/www/html/blog/” to “/var/www/html”. The process was easy and it only took about a quarter of an hour. Imagine my surprise when it just worked. There were a few references to the old location but the search and replace plugin that I used for SSL came into play again – just change “” to “”. It seemed too easy but it was a complete success.

So, two out of the three steps accomplished in an afternoon. SSL installed and working and the actual web site files in a more sensible place.

Onwards to step three. Search Engine Optimisation.

Yoast SEO is now working

SEO is something I know very little about. Google and the like are big mysteries to me.

I’ve read a heap about SEO but I still don’t understand the way Google actually works. After reading docs from WordPress and Google I went with the flow and installed Yoast. People seem to swear by it and there seems to be a pretty good user community.

The reason for SEO is that I’ve also got AdSense or Google Ads in a sort of vague effort to make a bit of money from this site. That means I need a lot more visitors who can the click on the ads which sends a minuscule bit of cash my way. The way to get more visitors is shameless promotion and Search Engine Optimisation which means a SEO plugin. Yoast is the one I chose so we’ll see how it goes.

Installing and configuring was really no different to any plugin and went without a hitch. I don’t expect miracle’s  but we’ll see how we go.

Wrestling with Google AdSense

Oh boy this was a struggle.

I figured that if I was going to make any money at all from the site it would be through advertising. After having a look around, and readging what others have had to say, I went with AdSense.

Getting the advertisements displayed on the site was really easy. Just follow the instructions on the AdSense site and you’ll have advertisements showing up in no time.

Of course there’s always a problem. This time it was the placement of the adverts. Google seemed to place them all over the place. All I wanted, but seemed unable to get, was an advert at the top of the page and another at the bottom of the sidebar. Too much to ask I hear.

Enter the Advanced Ads WordPress plugin. This made life a lot easier – especially now that I understand a bit more about how it works. I still couldn’t get what I wanted but I was getting closer. The I read something in the Advanced Ads documentation about child themes. I did a lot more reading and found out that with a child theme I could just have the two adverts where I wanted them.

As you can see I now have an ad at the bottom of the right hand sidebar and at the top of every page. The ad at the top is too high for my liking because I haven’t quite worked out to halve its height. I’m still testing the child theme on another test site and when I get it working right I’ll incorporate it into this one.

The final word

Well now that I’ve just about finished messing around with the site infrastructure I’ll be able to put up some more actual content.

Jenny and I have started planning a big trip of about six months and I’ve started a series of posts about that. Stand by for further news on that front.

Taming WordPress

Installation and testing

This is the easy bit. There are any number of good web sites that describe how to get Apache2 installed and running as well as MariaDB and PHP. With the benefit of hindsight I’d also get SSL happening as well but I didn’t and now I’m faced with the prospect of retrofitting it which is something I can’t be bothered with right now.

The sites that you want to make use of are php and apache2 for getting apache and php up and running. The simplest way to get good documentation and HOWTO’s for getting things installed and running is to just google search for eg. “raspberry pi apache” and “raspberry pi php”

Installing WordPress is as simple as downloading the latest version from WordPress and unzipping it to the folder (directory) of choise. Usually /var/www/html on a Pi.

As ever with this sort of endeavour just remember “google is your friend”…

Configuring WordPress

Before you start adding any content to WordPress get it configured. Get your database name and stuff sorted. Get your WordPress folders sorted. Don’t be tempted to start downloading themes and plugins. Just get the basic configuring done.

If you, like me, manage to wreck everything you can always go back to a freshly created SD card and start from scratch without losing anything apart from some time that can be written off as a learning experience.

The WordPress web site is chock full of useful informtion and documentation. They spent a lot of time writing it so it behoves me to spend a lot of time reading it.

Getting it all togther

By now you should have WordPress up and running and configured and it’s time to start adding a bit of content, right ?

Wrong. Now that you’ve got it all working it’s time to take a backup. Right now. It may save you a heap of time in the future.

The Raspbian Buster installation provides a handy SD card cloning tool. Using another SD card and a handy SD card adapter or a multi card reader use the cloning tool and when it’s finished test the card by booting you Pi from it. You will have two identical cards if it all went well.

Now it’s time to starting adding a bit of content.

Adding content.

This where the fun really starts.

The first thing to is to pick a theme. Any theme. This site is based on the 2016 theme and is one of the themes in the distribution of WordPress. It’s pretty simple and easily customisable.

There are few plugins that will help with adding content too. I have a few that I wouldn’t be without.

  • Back Button Widget
  • Contact Form 7
  • Display Posts
  • Email Subscribers & Newsletters
  • Page Builder by SiteOrigin This one is a must have. It makes building pages dead easy.
  • SiteOrigin Widgets Bundle Also a must have.
  • Page-list
  • Updraft a must have to backup your site.

Other plugins that I use to make life a bit easier are :-

  • WP Sitemap Page
  • WP Social Sharing
  • WP Statistics.

One thing I’ll say about plugins and themes is get rid of them if you aren’t going to use them. If you have a change of heart they are easily downloaded and installed again.

Now to actually adding content. For starters I used any old photos and documents. I played around with tags and categories until I got a handle on how they work. If you use an iPhone get BIRU-WP as it’s a very handy tool for resizing and uploading photos directly from your phone.

Once you have your theme and plugins knocked into shape you can get rid of your test content and start on the real stuff.

The BIG thing to remember is to get rid of the themes and plugins that you don’t use otherwise you’ll end up in some sort of plugin and theme hell.


The end

From the outset this isn’t to be considered a complete step by step HOWTO but rather a bit of a guide as to the order to do things. I would recommend that at the end of every major step you clone your SD card so that you have a known good point to go back to when you screw it all up.

After I got LAMP and WordPress configured and working properly I moved the “/” partition off to an SSD and I make use of the SD cloning utility and RSYNC on a regular basis because I really don’t want to lose what I’ve created.