Wordpress SEO Expert

Improve your Google ranking with Peter Mahoney, 20+ years SEO & Wordpress experience

  • SEO Overhaul
  • SEO Campaign
  • WP Support
  • Blog
    • SEO Emails
  • Praise

Displaying code snippets easily

February 21, 2013 by Peter Wordpress SEO Expert

With the new site and all I’ve some CSS to get through.

I wanted to make the “pre” element work as a code snippet display for me, and needed a fix to get it to wrap text (since the “width” attribute has been defunct for some time).

Here’s the solution!

pre {
 background-color: #F2F2F2;
 padding: 5px 5px 5px 5px;
 white-space: pre-wrap;       /* css-3 */
 white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
 white-space: -pre-wrap;      /* Opera 4-6 */
 white-space: -o-pre-wrap;    /* Opera 7 */
 word-wrap: break-word;       /* Internet Explorer 5.5+ */
}

Filed Under: Nerd-stream, Uncategorized Tagged With: code, CSS, snippets

Make a “Share on Twitter” link with URL and Hashtags

February 19, 2013 by Peter Wordpress SEO Expert

This is a little coding trick I get asked about quite a bit.

The link you have to make to share something to Twitter is quite simple:

http://twitter.com/share?text=text goes here

But getting a URL and hastag in there is a different matter. To be honest most developers do know how to include the URL, but hashtags have proved more elusive!

http://twitter.com/share?text=text goes here&url=http://url goes here&hashtags=hashtag1,hashtag2,hashtag3

Here’s an example to try out:

http://twitter.com/share?text=Here’s an awesome tip!&url=https://peter.mahoneywebmarketing.com/make-a-share-on-twitter-link-with-url-and-hashtags/&hashtags=peter,is,awesome

And that’s it!

Filed Under: Code, Nerd-stream Tagged With: hashtagnerdy, hastags, linking to twitter with hashtags, Twitter, url

Website code template

February 13, 2013 by Peter Wordpress SEO Expert

This is for my fellow developers out there.

I have a small series of files I copy and paste whenever I’m about to start a new project, they have default templates for various files I use a lot. Like a header, footer, index page, blank stylesheet, and something called “top.php” that I use to open sessions and connect to databases.

There are also some of my standard folders pre-made too (with the correct server permissions) like “img” (images) and “upl” (uploads).

This was going to be last week’s #fridayfreebie, but here it is on a Wednesday instead.

This particular version is the one I use most commonly, and it’s set up for:

  • PHP
  • MySQL
  • HTML5
  • CSS (any version!)
  • and ideally a unix/linux based server, because it references the top level of the site as being “/”.

I’ve zipped it up to share! Feel free to do whatever you want with it—although there is a lot of Peter Mahoney specific stuff in there, so you might want to take that out. Unless of course you like giving me credit for your work. 🙂

HTML5 website template (.zip)

Filed Under: Code, Freebies, Nerd-stream Tagged With: #fridayfreebie, CSS, files, footer, header, html5, mysql, PHP, template, top.php, website template

Issue with wifi caused by BT HomeHub update to software version 4.7.5.1.83.8.94.1.11 (Type A)

December 23, 2012 by Peter Wordpress SEO Expert

I’ve been having major issues with wifi the past few days, and it turns out they’re all caused by an update to my router by BT. Now, this post is going to seem pretty nerdy, but this issue may affect more of you than you think!

I’ve spent the past three hours looking into this. You see, I’ve got a pretty complicated home network, fortunately I’m skilled in such things so it’s never been a problem. But it does mean when my wifi became unstable I had a lot of variables to consider and check.

A few days ago I noticed my internet connections started to drop-out every 40 seconds or so. Whether it was a local connection (one computer at home talking to another) or going out through the internet (searching Google, checking Facebook, downloading files, etc.).

I didn’t realise it was a wifi problem until I did some testing, after all every one of my devices connect wirelessly, so it seemed to be a problem affecting everything.

I ran some tests (pinging various machines and remote servers) and it confirmed what I’d noticed. After updating and checking everything I could that I’d set up myself (and extra repeater router, my server, desktop and laptop software) in desperation I checked to see if I could upgrade my BT HomeHub3’s firmware.

Oh. BT updated it automatically a few days ago. Precisely when the trouble began. A quick search shows a number of their customers complaining that their wifi has stopped working since the update, FYI it’s called 4.7.5.1.83.8.94.1.11 (Type A).

The update “fixes” something called Smart Wifi. The solution is to turn it off.

There is no setting for Smart Wifi on a HomeHub3. In fact it’s a background process, to turn it off you need to manually select a channel for your wifi to use, instead of the default “Automatic” setting.

Now, I already was using a manual channel: channel 6. Nonetheless I I thought perhaps I need to change a few things to fix the Smart Wifi issue, so I turned it back to automatic, then once again to channel 6. Still the issue.

A post on BT’s customer forums alluded that perhaps BT uses channel 6 as a default, so it might not turn off Smart Wifi if I stay on that channel. I can’t confirm if that’s true, but I do know when I changed to a different channel (in my case, 11) SUCCESS!

All my tests show an excellent, stable connection once more.

I should trust myself and my skills more–and assumed BT were likely responsible from the outset. They usually are.

Filed Under: Hints & Tips, Nerd-stream Tagged With: BT, firmware, fixed, issue, problem, router, success, tested, wifi

How do you annoy a web developer?

December 9, 2012 by Peter Wordpress SEO Expert

This is the briefest of posts, because the content is entirely thanks to the wonderful xkcd comic, and it’s pretty damn nerdy.

First person in the comments to exclaim that they get it, and can give some sort of rationale, gets a prize.

via xkcd: Tags.

Filed Under: Code, Hints & Tips, Nerd-stream Tagged With: comic, humour, tags, web development, xkcd

Speeding up your site

October 30, 2012 by Peter Wordpress SEO Expert

There is a slew of methods to speed your site up–which is not only the polite thing to do for your guests–but helps with Speed Engine Optimisation (SEO) too. Google in particular looks at how quickly your site loads when deciding how to rank your site in search results.

Now, if you’re familiar with web servers then everything you need to know is written below. If not, this is the sort of thing you want to have an expert do for you; a faster site is too good an opportunity to pass up.

Browser caching is a process whereby we’re able to reduce the number of HTTP requests the server needs to process, which reduced page load times. Your server tells the visitor’s browser not to look for certain files everytime–usually the file that don’t change often anyway.

Edit your .htaccess file for your site, and include this code:

## EXPIRES CACHING ##
# by Peter Mahoney of petermahoney.com
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
</IfModule>
## EXPIRES CACHING ##

Restart your web server, and you’re done!

Noe this isn’t all there is to optimising a website for speed. Especially WordPress websites. As you’ll know by now I’m a WordPress SEO expert so I really pay a lot of attention to speed. There are plugins, image compression techniques and even extra code snippets worth using.

When it comes to plugin choice for WordPress speed I recommend WP Rocket – it does a great job out of the box and with just a few setting changes you can really push the envelope. Using that as well as a series of manual image compression techniques I’m able to improve the average WordPress site’s speed by 40%!

Speeding things up usually does require a few manual tweaks to code here and there – it’s really a job for a professional rather than just trying it yourself (it’s all too easy to stop a site working properly with this stuff.)

I can’t recommend a faster site enough. For your users, SEO – hell even the good of the web itself. Let’s get that content flying.

Filed Under: Code, Nerd-stream, Website Speed, Wordpress Tagged With: code, htaccess, search engine optimisation, seo, site speed, web server

  • « Previous Page
  • 1
  • …
  • 23
  • 24
  • 25
  • 26
  • Next Page »

Get FREE Wordpress SEO tips!

I send regular newsletters with WordPress SEO expert-level tips. Sign up to get them, along with my FREE e-book “Ongoing SEO Success”.

Did I mention they’re free!

Subscribe for free

Praise

I have over 2,500 5-star feedback reviews (and I’ve never received less than the full five.)

Here’s just one example, from Mike who runs Costello Entertainments:

Migration, Hosting, SEO and Speed Work on our new website all completed quickly and efficiently and Peter was most helpful in fixing an issue with a Popover on the site as well. If you’re thinking about asking Peter to do a job for you or hesitating, JUST DO IT! – He knows programming and the internet inside out, he’ll get the job done for you professionally, with a smile. I wish I could call a plumber or a tradesman to do the jobs I can’t do myself with the same level of confidence.
Read a lot more.

Recent Blogs

  • Outreach for backlinks – how to get quality links that Google will love
    I’m thinking of redirecting my Virtual Assistant work to other tasks as the generic LinkedIn work I ...
  • (Small) Pricing changes for 2025
    When COVID first hit, like a lot of people around the world I wanted to help my clients as much as possible ...
  • My site has errors – timeouts – and my host isn’t helping me
    Hi Peter, My site has been reporting errors (timeouts) which have become more regular the past week or so. I ...
  • How do we fix 404 errors after a site move or migration?
    Hi Peter, We migrated from Visualsoft to Woocommerce approx. 10 days ago and are experiencing 404 errors. ...

Legal

  • Terms and conditions
  • Privacy policy
  • Disclaimer

Prices are quoted exclusive of VAT unless expressly stated.

Also read

  • Payment information

RSS

Peter Mahoney, WordPress SEO expert blog

Recent Posts

  • Outreach for backlinks – how to get quality links that Google will love
  • (Small) Pricing changes for 2025
  • My site has errors – timeouts – and my host isn’t helping me
  • How do we fix 404 errors after a site move or migration?
  • Why does SEMRush show my ranking change so much?

© Copyright 2025 Wordpress SEO Expert · All Rights Reserved · Site by Peter Mahoney