Five Practical WordPress Database Tips

Source: Internet
Author: User
Keywords WordPress

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

WordPress has a wealth of plug-ins, themes, the success of the vast number of bloggers to build blog tools, wordpress blog is supported by MySQL, in the blog writing process, sometimes have to involve some of the operation of MySQL database, although, Plug-ins and code changes can also help us solve problems, However, this is also a symptom is not the root causes of the rich, random, reasonable use of phpmyadmin to carry out the operation of the data is very necessary.

What can phpmyadmin do to help us? This article is to introduce you to WordPress more useful several operations:

1. Backup Database

Database backup for our webmaster is very necessary, this network storm involved a lot of webmaster, if the site backup, then it can be restored in a short period of time, do not let the meeting, your site is over, of course, You can also use the Wp-db-backup plug-in to perform a database backup is very convenient, WordPress users can install the plug-in and regularly back up the data.

2. Quick Delete spam comments

WordPress Interactive is also one of its advantages, can be this advantage by a lot of 17828.html "> Spam ads, but, through a simple DELETE statement, you can solve this problem, the implementation of this command:

DELETE from wp_comments WHERE comment_approved = ' 0 ';

Then, all the spam ads can be deleted.

3. Reset Password manually

WordPress in order to increase security, will automatically generate difficult to crack the secret, but, sometimes the blogger will also appear to forget the password things happen, this is, we can be phpmyadmin to make a modified password, use the following command can be:

UPDATE ' wp_users ' SET ' user_pass ' = MD5 (' PASSWORD ') WHERE ' wp_users '. ' User_login ' = ' admin ' LIMIT 1;

The password was modified successfully.

4, change the domain name

Re-changing the domain name, you need to change the blog's domain name while retaining the blog and data. Because WordPress stores the domain name in the database, so in order to connect the new domain name and the blog, you must change the database, use the following command 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 ';

Use the following statement to override the relative URL of all logs (GUID globally unique identifier)

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

Search the Wp_posts table and replace the URL to ensure that no old URLs exist:

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

This completes the domain name modification, you have to be able to use your blog completely

5, modify the WordPress database

WordPress version upgrade faster, so, upgrade blog is not necessary, if the modification or upgrade process or other reasons caused the loss of blog data or damage, I hope you have a backup of the database, so that you can back up the database into the database to make up the loss.

In addition to the five methods described above, we can also use it to "change log Properties" and other operations, overall, the phpMyAdmin function is very strong, it can help us better use the MySQL database.

If you are interested in WordPress development, you can see the Chinese translation of WordPress documents http://www.wordpress.la/codex.html,wordpress development of relevant knowledge, the development of WordPress interested bloggers will have some useful.

Original article, reprint please specify: www.wordpress.la

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.