loitrewasのブログ -3ページ目

loitrewasのブログ

ブログの説明を入力します。

Eight Useful WordPress SQL statementsin the past decade, MySQL has become a popular database, WordPress blog using a MySQL database, although the use of plug-ins can solve some problems, but to achieve some particular tasks, execute SQL statements in phpMyAdmin is The most succinct way to summarize Air Jordan 6 Rings here eight useful WordPress system SQL statements to solve some practical problems encountered. 1. Create a backup of the database backup of the database is the first thing, only through the following methods can simply back up the database: Sign in phpMyAdmin. Select your WordPress database, and then click the Export button, select a compression method (you can use gzip) and click the Execute button, when the browser you are prompted to download, the point is that the database file is downloaded to the local. 2, bulk delete articles WordPress2.6 later revised version adds a Post revisions function, though a bit with, but the article amendments increase the size of your database, we can choose to batch delete. After login phpMyAdmin execute the following SQL statement to bulk delete. DELETE FROM wp_posts WHERE post_type = revision; 3, bulk delete spam comments a true story, one of my friend set up a blog on the Internet, there are times he spent a few days on vacation, no Internet, and when he came back , log in to your blog, we saw more than 5,000 comments awaiting approval, of course, most of them are spam, you want to manually delete these comments to spend a lot of time, so we can use the following approach. Execute the following SQL statement after logging in phpMyAdmin. DELETE from wp_comments 2015 Latest Nike Shoes WHERE comment_approved = '0'; Be careful, though this solution is useful for processing millions of junk surface, but will remove unauthorized comments, it is best to install and use Akismet to deal with spam . 4, modify article properties after you install WordPress, admin account is created, many people mistakenly use this account to write Nike Air Max 90 Premium a blog, until they realize that this is not a personal account. The solution, each article Amendment of the property needs a lot of time, the following SQL statement can help you quickly complete this function. First you have to Nike Air Max 2013 find your correct user name, use the following SQL statement can be found in your user ID number. SELECT ID, display_name FROM wp_users; assuming that ID is NEW_AUTHOR_ID, and the administrator admin ID for OLD_AUTHOR_ID, then run the following SQL statement. UPDATE wp_posts SET post_author = NEW_AUTHOR_ID WHERE post_author = OLD_AUTHOR_ID; 5, manual reset your password lot of people to protect their blog not being hacked, using a very complex password, although this is a good thing, but often forgotten happen things administrator password. Of course, you can send to your WordPress link to reset your password via e-mail, but if you can not access your e-mail address, then you have to use the following SQL statements to reset your password. UPDATE wp_users SET user_pass = MD5 ('PASSWORD') WHERE wp_users.user_login = 'admin' LIMIT 1; MD5 hash function is a built-in MySQL, is used to convert the password hash values. 6. Change the WordPress domain you may sometimes want to change your blog's domain name, but WordPress will your domain name is stored in the Cheapest Nike Air Force 1 Mens White Blue Shoes database, so you have to use the following SQL statement to modify. 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'; then, you also To use the following article GUID SQL will also be modified. UPDATE wp_posts SET guid = replace (guid, 'http: //www.oldsite.com','http: //www.newsite.com'); Finally, use the following statement will replace the article, all the old domain to the new domain name . UPDATE wp_posts SET post_content = replace (post_content, 'http://www.oldsite.com', 'http://www.newsite.com'); 7, show the number of SQL query performance when you have the time, then blog, understanding the number of queries to the database is very important, in order to reduce database query, we need to know on one page in the end how many queries. This time, do not need to log in phpMyAdmin, you only need to modify the footer.php file, at the end of the file add the following lines of code. ? Php if (is_user_logged_in ()) {?? Php echo get_num_queries ();? Queries in php timer_stop (1);?? Seconds php.?} 8, restore your WordPress database when your database for some reason (? hacker or upgrade error) is damaged or lost, if you have a backup, then you can restore your WordPress database. Login phpMyAdmin, Beautiful Nike Air Force 1 High Womens Black Pink Shoes select your WordPress database, point Import button, click the Browse button, then select your New Nike Air Force 1 Mens Red White Shoes hard disk from a backup file, click the Execute button on the database can be imported. If all goes well, your WordPress functions will return to normal. English original: 8 Useful WordPress SQL Hacks Chinese translation: William Long Chinese translation: Eight Useful WordPress SQL statements