Tag Archive wp

Byq292u

WordPress Database – Delete Orphaned Posts

Delete Orphaned Posts

After manually using SQL to delete users, you can be left with (potentially a lot) of posts which now belong to users who simply don’t exist. You don’t want this, it wastes space and clogs things up.
There are two solutions to this:

  1. Delete the Orphaned Posts
  2. Assign them to another user.

I’m going to use option1, as I deleted those users for a reason – Spamming!

From PLESK or CPANEL database web admin:

Delete Orphaned Posts

DELETE
FROM `wp_posts`
WHERE post_author NOT
IN (
SELECT id
FROM wp_users
);

NONE of my tables have a wp_ prefix!

Now DELETE ORPHANED POSTMETA..

** BACKUP YOUR DATABASE FIRST!

Please note: You should NEVER leave your tables with the default “wp_” prefix. Or have a user called “admin”, or a user with id=1. That’s just for start!
Let us secure your WordPress site for you:
http://www.q292u.com/services/secure-your-wordpress-site-our-new-fiverr-gig

Byq292u

WordPress Multisite Problems

We’re currently working on a Multisite WordPress Installation for an educational establishment. The problem is that the server is accessed via a proxy on their main domain.
Their technical people advised us to set up the wp install using the server name. We’ll call it “Gomez”. Gomez isn’t accessible from the internet, so it’s accessed via www.domain.ac.uk/proxyname. That’s fine, except that it only works internally. 🙁
Also, it switches all the URLs back to Gomez once you are through the proxy. 🙁
Using a “requestheader host” statement in the htaccess file throws a WP error – it thinks there’s a port number in the URL!
You wouldn’t believe how difficult it is to change the URLs within a WP Multisite install!
We have to use sql queries to replace all occurrences of the original URL with the new one, for ALL the sub blogs as well as the master one. After editing the wp-config file.
It looks like WP multisite has some way to go before maturity..

Byq292u

WordPress Optimisation

I’ve just been comparing the pageload times for two of my similar (architecture, not content) wordpress sites.

Site A was coming in at about 1000-1500 milliseconds, whereas Site B was anything up to 6000 milliseconds 🙁

Turns out that caching had been disabled during a search to find a dodgy plugin, but never re-enabled on Site B..

That got me thinking though.. what if I could get the load time down.. would that improve the bounce-rate?

So, before I starting messing about with settings, I took some baseline stats with www.whichloadsfaster.com, (try it, it loads two pages in parallel, and measures load times..)

Then I re-enabled caching on site B. Suddenly, Site B loads faster than site A..
Next move: use the same caching settings on Site B on Site A.. (Site B had compression turned OFF, A was ON..)
Bingo! Both sites are now around 700-1000 milliseconds!

Next move: use the csprites plugin on both sites. (this makes dynamic css sprites from the images, loads faster).

We are now down to 500-750 Milliseconds on BOTH sites.

Can I just remind you of where we started here?

Site Before (ms) After (ms)
A 1000-1500 500-750
B 6000 500-750

P.S. this took less than half an hour, all-in..

Plugins used: wp-supercache, csprites
Tools used: www.whichloadsfaster.com


Byq292u

Tumblr

Experimenting with Tumblr blogging.
I’ve set up two Tumblr blogs corresponding to WordPress sites. These sites have the wp2tumblr plugin installed, which creates tumblr posts when the WP posts are updated.

Unfortunately, it doesn’t work for RSS generated posts, but it’s easy enough to select multiple posts for edit, and just hit the update button.

We’ll see if anything gets referred from Tumblr..