Category Archives: Wordpress

When Blogs Collide

It’s the end of the world as we know it (merging WordPress blogs)

When Blogs Collide

You know how you have great ideas and you start them and you get side tracked by other things? This is the post about a few of them. You may know a few of my blogs that live in the wild? If not they are ( or now … they were ) Forbairt.ie JamesLarkin.ie BrittanyBeers.com. I’ve one or two others I may also pull into this one I’ll see iacceptcookies.com just doesn’t have enough useful content I’d like to have on here it’s an old blog without much value but there’s still quite a bit of link love in there I just need to figure out what I’m going to do with it.

Anyways I’ve gone and closed down those three blogs. Why? I just don’t have the time to write much decent content and writing a decent post on one means I’m neglecting the others so it ends up getting to the stage where I simply say what’s the point. Life has gotten in the way of a lot of things. With the arrival of my daughter my blog Brittany Beers which I was creating a few blog posts for suddenly died.

Forbairt.ie I re-created in the new year after my daughters birth and you know what it fizzled out after a few blog posts. Writing decent content isn’t that hard. It is however time consuming. I’m not assuming all my content is worth while but I have in the past created a few decent articles that ended up crashing my site at times due to lack of caching on my part.

Flash forward anyways to my current thinking. Too many blogs not enough Forbairt. So I’ve gone and merged them all into one. (No for the love of god think of the link love I hear you scream … or maybe not) I did however so here’s what I did. It it the perfect way of doing things? probably not but it’s what I’ve done so far and I’m open to suggestions if you know better.

WordPress actually offers a very simple way of moving content from one blog to another and that’s via Tools -> Export. Generally when I’m moving a blog I’ll opt for a complete database / file move to the new site and see how I get on. In this case however I want to merge blogs and not overwrite things so Export / Import to forbairt.com is the way to go for me.

The tools import section will look something like this …

WordPress Tools Import

If you don’t have the WordPress export tool you’ll be prompted to install it.

Install Importer Tool

Click click click and hey presto you’ll be able to export all posts.

WordPress Tools Export

Then on your destination blog you’re ready to import the XML file

WordPress Tools Import XML

Hey presto you’re almost done BUT wait … there’s more

Remember how your old website still exists? Well you don’t want to just nuke it so you’ll want to redirect over your content in a sane way. We do this by creating a redirect link. Simply put a 301 redirect link tells anybody who goes to the site that the content they are looking for now lives at this new address. We’ll dump this info into the .htaccess file on the old website.

In the case of forbairt.ie the website had a domain/postname structure so this made things rather simple and by putting

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^forbairt\.ie$ [NC]
RewriteRule ^(.*)$ http://forbairt.com/$1 [L,NC,R=301]

into the .htaccess file I was good to go.

Moving JamesLarkin.ie turned out a bit a bit trickier why you might ask? Well posts on that site were in the format of domain/year/month/day/postname so a small bit more regexp magic was required

Options +FollowSymlinks
RewriteEngine On
RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*)$ http://forbairt.com/$4
RedirectMatch 301 ^(.*)$ http://forbairt.com/$1

Finally in moving BrittanyBeers.com over I noted that I had one page the about page on there that I didn’t want to include as an about page on forbairt.com so hey presto .htaccess rules to the rescue. I recreated the original about page from Brittany Beers as a post on the new site and gave it the old date. I think went ahead and added the following redirect from there …

RedirectMatch 301 ^/(about)/*$ http://forbairt.com/brittany-beers/

Taking me from the original matching /about to the /brittany-beers post to the new website blog post I’d setup.

All in all I’m rather happy with the results so far have I missed something probably so I ended up installing the Redirection plugin from WordPress at least for a few days. It lets me know things like what’s not getting redirected correctly and I can then go ahead and setup appropriate redirects. It also alerted me to the fact I’d forgotten the permalink structure for jameslarkin.ie was different to the current blog.

Wordpress Redirection Plugin

Me I’m happy out all the content in the one place seems a lot more worthwhile and less spread out. Who knows I may even keep on blogging

 

 

 

my wordpress site got hacked

A few weeks ago I upgraded to the latest 3.2.1 release of wordpress. Of course like everyone I’ve a few what I’ll call core plugins I require.

The most recent of these to get added to my list is Donncha O’Caoimh’s http://ocaoimh.ie/exploit-scanner/

Of course when I installed it at the same time as installing the 3.2.1 release of wordpress the hash files weren’t available for 3.2.1. This lead me to lots of False positives. Yesterday then when I scanned I for some reason thought I was seeing the same thing. I mean upd.php and config.php seem like two perfectly normal files don’t they? Well hell no after asking a rather silly question over on Google Plus I realised the error of my ways and went about fixing things.

Exploit Scanner works on the basis that all your core files should have the same hash as a clean version. ( A hash is a value that gets created and mostly two different things can’t have the same hash )

Exploit Scanner Results
Click to enlarge

 

The md5 Hashes for the two files are as follows

  • exploit-scanner.php (1.0.5): ac8d7f3574a7470a245a2067e9c79072
  • hashes-3.2.1.php: a660a35382f648c8735414a7d3531970

So if your websites version of these doesn’t match it’s fair to assume someone has edited the files on your site. You can always find these values on the exploit scanner plugin page. It’s well worth installing.

Install Exploit Scanner

The Exploit scanner immediately told me about the errors. Unfortunately it’s a bit of a manual process as you still need to see what’s wrong and make sure the files aren’t valid. So backing up is a good idea first. I also ended up removing a few unused plugins and all the old themes I had on the site. It doesn’t have hash values for any plugins or themes you’re using so you may need to manually scan these and check if they have been altered. One way I did this was visually check the date of creation / modification of the files in my ftp client.

Anyways exploit scanner is about to become the first plugin that gets installed on all new wordpress installs ( and even a few older ones ) and I’m debating creating a rather simple script to show the last edited / created time for files as I’d find that one handy as well. The files were uploaded to my site on the 6th august for example. I know I wasn’t doing much there then so apart from an image or two and my cache things shouldn’t have been changed recently.