One of the benefits of WordPress is that even without coding knowledge, anyone can easily create beautiful and powerful websites. Without writing code, you can set up the website from scratch, display the website accurately as needed, and perform the required actions. However, its advantage is that you can manually adjust the WordPress backend. A typical text news site uses many types of code. HTML and CSS are used to control the visual appearance of the site, PHP and JavaScript provide the functions of the site, and SQL (combined with PHP) is used to communicate with users. database The
All content on the website is stored in the database together with the infrastructure and user information of the word press database. This makes the WordPress site a dynamic site type. Unlike static sites that use pre created HTML files, HTML will be generated in real time. Whenever someone visits a WordPress site, they use a series of SQL queries to get content from the database. All data used by the site is stored in tables in the database. You can think of a table as a repository container for one type of data, so you can store different types of data in another table to organize the data. The
The core word press table is as follows: Wp_posts – all content, menu data, and media attachments on posts and pages. Wp_posteta – metadata for each post. Adding custom fields to a post adds metadata to this table. For example, you can add music you were listening to when the post was created. Wp_comments – all comments of Posts and pages wp_commentmeta – metadata of comments, including author, date, email, etc. Wp_users – user name, password (encrypted), and other user data. Wp_usermeta – metadata of the user. Wp_options – general word press settings. Wp_links – for blogrol links that are not actually used on most word press sites today. Wp_terms – the category and label of the post. Wp_termmeta – metadata for categories and tags. Wp\u term\u relations – links posts with categories and tags. Wp\u term\u taxonomy – taxonomy is used to classify data. WordPress is classified into categories, tags, and links by default. This form manages the taxonomy, including the name and description. These are the default word press tables, but there may be other tables added by the installed plug-ins and themes. The
Word press tables may have different prefixes. \
How to use SQL commands in the WordPress database the PHP code of the WordPress site contains SQL commands for communicating with the database, but it is more convenient to send SQL commands manually if you want to perform database operations manually. WordPress uses MySQL as the database management system. MySQL does not come with a graphical user interface
It can be managed from the command line, but most users can \
Depending on the web host, you may be automatically redirected to the phpMyAdmin home page, or you may need to enter a user name and password first. These details should be provided when setting up a managed account, but if you are unsure, please contact managed support. After login, the following screen must be displayed: The database is listed in the lower left corner. For each word press site installed on the server, there must be one. There may be other databases that are not related to word press. If you find the database of the site you want to work on and click (if you are not sure which database is the correct database, you can find it in the wp-config.php file next to db_name), If you are a new word press installation, you will get an overview of all tables in the database. These tables must be the same as the tables listed above. The
Male create a new table on this page, and then click the existing table to view the data. There are various tabs at the top of the page that you can click to perform various functions. Unless you want to export problems during SQL lookup and then start using the imported operation routine event trigger designer advanced database, you don’t have to worry about most problems, but it’s worth checking out a few. The database search Search tab allows you to find and edit records independently without using SQL commands. For example, to search for a specific user by e-mail, enter the e-mail address in the search box and select wp\u users database (or search the entire database). The
After the search is completed, click the \
Fortunately, this is really easy (especially if you have a large database or the WordPress site does not share the database with other programs, please follow the custom backup procedure here). Simply navigate to the export tab, select quick as the export method, select SQL as the format, and then click the move button. The file can be ed to the computer and moved to a safe storage location. If you need to restore from a backup, go to the import tab, select the backup file, and then click Move (in most cases, the default setting is valid). The
In PHP myadmin, click the SQL command to run the SQL tab and navigate to the screen with a large text box. Here, you can enter SQL commands to query and edit the database. The useful SQL commands of WordPress can now see the database and query, so it’s fun to start. In general, you can use impossible manual SQL commands to perform some very useful operations without the help of third-party plug-ins. If the table has a different prefix (not beginning with \
Only databases can take up a lot of space. It can be deleted through the following query: Delete a, B, C from wp\u posts a left join wp\u term\u relationships B on (a.id = b.object\u ID) left join wp\u postmeta C on (a.id = c.post\u ID) where a.post\u type =’revision’; 8. disable comments on old posts sparmer often targets old posts. Use this query to close comments on all posts posted before a specific date (edit the date to the desired date). Update wp\u posts set comment\u status =’closed’where post\u date <‘ 2016-01-01’and post_status =’publish’; 9. if you migrated the URLs of WordPress images to change the WordPress site, you must change all image URLs. To save server space, you may decide to host the image elsewhere. To change the image URL, use the following query: Update wp\u posts set post\u content = replace (post\u content,’old url’,’New url’); 10. most of the technical problems of the WordPress site with batch disabled plug-ins can be re tracked through bad plug-ins. If you cannot access the management panel, you can disable all plug-ins in the database first, and then re enable them one by one. Update wp\u options set option\u value = ”Where option\u name =’ active\u plugins’; 11. have all posts been attacked by spam with comments disabled? Or did you fully accept others’ opinions? You can use the following query to close comments on all posts at once: Update wp\u posts set comment\u status =’closed’where post\u type =’post’; Knowing the WordPress database and how it works can grant more permissions to your site, and you can directly use the site data without installing a large number of plug-ins. However, if you don’t know what you’re doing, there’s a risk of messing up your site database, so it’s important to make sure you always have a backup before you start editing your database. In fact, it is better to set the test site as playable sample data to better understand what these different SQL queries are doing before trying on site. You can use the duplicator plug-in to create a site copy of the test. If you want to test the data on the test site and make it blank again, you can use the plug-in to reset the word press database to the default state.