Plugin to get a database backup from a WordPress installation

I usually want to extract a database backup from my live WordPress installations. Sometimes I am lucky and can ssh into the machine and use mysqldump directly and sometimes I need to use PHPMyAdmin.

But, every now and again I loose my login details to all those different hosting companies and it would be nice to get a database dump directly from the WordPress installation itself.

One plugin that solves this for me, is WP Migrate DB, so if I just can remember how to login to the WordPress installation, then it will be quite easy to get the wanted database dump.

Enable automatic update of WordPress and skip FTP details

I want to use the automatic update of WordPress which seems to work fine on hosting services but not on my local installation.

I try to solve it by doing chmod -R 777 on the installation, but that does not do the trick on its own.

Adding a row like this to wp-config.php however does the trick.

define('FS_METHOD','direct');

An explanation of why it is like this, was found in this excellent StackOverflow response.

Adding comment and like count to WordPress plugin Simple Instagram

This is really not a proper way of doing it, but I did it anyway.

I have this WordPress plugin for Instagram, Simple Instagram its called. I thought it would be nice to have the comment count and like count when hovering over the images. So, just for fun I tried to edit the existing plugin to make it work. Here are my notes on how I did it.

Continue reading Adding comment and like count to WordPress plugin Simple Instagram

Change the location of the image upload directory in WordPress

I always change the WordPress default upload directory for images, I usually want it somewhere in a subdirectory of the /img directory, together with all other images. I find it easier to manage all images when they are stored in one location.

So, for my own personal note, this is what I do. In the file wp-config.php I set the relative path to the image directory.

// Directory for uploading images
define('UPLOADS', '../img/wp');

Now, all images will reside in this directory. Be sure to verify that upload works. The directory path must be relative the installation directory of WordPress and the UPLOADS directory must be writable by the webserver.

Check and change WordPress site & home location using SQL

I tend to move around the WordPress sites, moving from one development server to another and moving between hosting companies.

The SQL-queries below, tend to be most useful when moving these installations between hosts and directories. They check, and set, where the WordPress installation directory is (siteurl) and what the home url should be (home).

First check.

SELECT * FROM wp_options WHERE option_name IN ('siteurl', 'home');

Then set it.

UPDATE wp_options SET option_value='http://www.mikaelroos.se/wordpress' WHERE option_name='siteurl';
UPDATE wp_options SET option_value='http://www.mikaelroos.se/' WHERE option_name='home';

I find it much easier doing this by SQL than using the admin interface.

Hi there, I’m Mikael…

I have had this domain for a couple of years now, thinking “Lets create a nice micro MVC framework and build my own website”. Yea, right. When will I ever get the time to do that?

So, I thought, why not do the opposite? Just download the latest WordPress, use default theme with default settings and start using it. Its not really what I imagined for this site. But its here, I can write some posts and I can continue to code on my other projects. That’s pretty good for now.

There will always be a tomorrow, when I could prioritize this site and build the best ever framework. So, I’ll leave that for tomorrow, today I’m quite happy that I just can start writing and show off my standard WordPress me-page.

Anyhow – you are most welcome here, enjoy!