Scrap your post revision with SQL shredder!




Tagged Under : , , , ,

Version: 15.1
Revision: 45 Build 13

Scrap your post revision with SQL shredder!

phpmyadmin_logoIntroduction:
On Halloween day, I was bored as hell! I am too old for these “Trick ‘N’ Treat” sort of things.
But, I did have a good time writing my own article and give the other children and the others candies, chocolate and sweets. So, what about my readers? Don’t worry! Here is a mini – tutorial for you to learn and enjoy.

This tutorial is about controlling your “WP – post revision” with a little help from “phpMyAdmin – Query and by editing your wp-config.php file.” However, please be careful when you’re modifying your “wp-config.php” file.

Notes: The “config” file is the hearth of your Wordpress database. So, in my own judgment, just make a backup of your “wp-config.php” file.
It’s not that hard – for crying out loud…

1.] Login to your Cpanel and navigate to your blog’s directory. After that, you’ll need to edit your ‘wp-config.php’ file and add these lines into the top of your file.

define ('WP_POST_REVISIONS', 6); //Defines a maximum of 6 different revisions per post.
define ('AUTOSAVE_INTERVAL', 3600); // Auto-saves on 1 hour interval.

2.] Save your changes and exit your ‘config’ file.

3.] In your Cpanel directory [Home], please scroll down and look for “phpMyAdmin” and select it.

4.] Wait for the control panel to load its settings and click on your “SQL” icon.

Facts: this icon is called: SQL query command. It is located on the top – left – corner, which is next to a little house icon (Home).

5.] Copy this code and paste the following code into the “SQL command” window.

DELETE FROM wp_posts WHERE post_type = "revision";

6.] Execute the script and let it erase all of your previous “post – revision”.

7.] You’re Done!

Alternative for “WP – AUTOSAVE_INTERVAL”.

- There is another way to change your “Wordpress autosave interval.”
But, you’ll need to look for this file: “wp-settings.php” and edit these parts which is shown below.

Notes: The actual lines is around 522 – 528. Just scroll down or search for the lines with this phrase: “AUTOSAVE_INTERVAL.”

/**
 * It is possible to define this in wp-config.php
 * @since 2.5.0
 */
if ( !defined( 'AUTOSAVE_INTERVAL' ) )
	define( 'AUTOSAVE_INTERVAL', 60 );

— Times —
60 sec = 1 minutes
1800 sec = 30 minutes
1980 sec = 33 minutes
3000 sec = 50 minutes
3600 sec = 60 minutes

Copyrighted By Lair360




Transfer Wordpress Blog to a new Domain or Provider




Tagged Under : , , , , , , ,

Version: 13.2
Revision: 45 Build 11

Transfer Wordpress Blog to a new Domain or Provider.

Introductions:
Hi everyone! This is going to be my last post, before I traveled back to my country, for a vacation. But, don’t worry, I’ll be back in about 7 weeks with new articles and two new ebooks for you to buy. Since, I have SSL encryption, you don’t have to worry anymore!

For those who would like to buy my upcoming ebooks, please pre-order by paypal and I’ll post them to you when I am back. The price for these two books is £5.00 in total. This money will be use / spent to support Globalnews SSL certificate.

—————————

This tutorial was written for users who would like to move their Wordpress blog to a new domain or register for an SSL certificate.

Warning: please backup your SQL database before try / attempt this tutorial!

1.] First, you must login to your Cpanel and navigate yourself to phpMyAdmin. After that, you’ll need to select your “WordPress” database.
2.] Select the “Query” box or look for the specific strings within “wp-options”. However, you must use these codes in proper orders.

The following orders are shown below…

1a.] Select “wp-options” and click on “Browse”. After that, please look for these SQL strings and click Edit.
However, please look at the “option_value” and “option_name” before you edit the strings.

option_name: siteurl
option_name: home

When you see these strings, carefully change your Wordpress domain name or sub – directory.

b.] If you can’t find these strings, I would recommend you to use this “Query”. Nevertheless, this command can only be use in “phpMyAdmin” Query Box.

UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldsite.com', 'http://www.newsite.com') WHERE option_name = 'home' OR option_name = 'siteurl';

2.] When you’re done with ‘Step 1′, please erase your previous strings, then add this codes into your Query Box.

Notes: This query will update your old posts and pages, which is translated from post slug, and stored in database “wp_posts” table as “guid” field.

UPDATE wp_posts SET guid = replace(guid, 'http://www.oldsite.com','http://www.newsite.com');

3.] When you’re done with ‘Step 2′, please erase your previous strings, then add this codes into your Query Box.

Notes: This query will fix all internal links to your own blog, posts and pages.

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com');

4.] Finally, you’ll need to browse through WordPress blog to check if everything is functional.
You also need to re-login to WP Administration as authentication cookie has now became invalid due to different domain.

5.] This tutorial has ended, please keep this articles for future reference…

Copyrighted by Lair360




Wordpress – Delete Existing Post Revisions




Tagged Under : , , , , ,

Version: 12.1b
Revision: 44.2 Build 11

Wordpress – Delete Existing Post Revisions

Introduction:
on the 7th of June, 2009, my Wordpress SQL database was accumulating like crazy. However, I didn’t noticed this, right until I checked my Control Panel. After the initial login, I clicked on my server – upload statistic. Then, I checked my SQL Database – load – queries.

Guess what? My database size had about 10 MB of “WP Post Revisions” and the file is like…big!
So, I decided to use these tricks and disable my Wordpress post – revision. The process is very simple…

1.] Log into your Cpanel and backup your “wp-config.php” file. Then, add this “define” strings into your real (original) “config” file. However, you’ll need to place this code above your “database name, users and password.” But, if you add this code below these database strings, there is a high chance that you might delete your database password or username.

—Copy Source Code—

// ** Post Revision ** //
define('WP_POST_REVISIONS', false);

—End Source Code—

2.] When you’re done, please save your “wp-config.php” file and exit.

3.] Close your “FTP file manager” and direct yourself to “phpMyAdmin”.
Then, all you need to do is copy this code into the “Query”.

Warning: be sure to backup your database first, before performing any queries in phpMyAdmin.
—Copy Source Code—

delete x,y,z
from wp_posts x
left join wp_term_relationships y on (x.id = y.object_id)
left join wp_postmeta z on (x.id = z.post_id)
where x.post_type = 'revision'

—End Source Code—

4.] After this process, just relax and keep blogging!
You will also notice that your blog, it will respond faster.

Thanks for the support!

Copyrighted By Lair360