How to change wordpress adminstrator user ‘s ID from 1 to 0?

The MySQL table that stores the user data wp_users have an autoincrement on the primary key ID. The database will handle it automatically to avoid duplicated values and the minimal value is 1. There is nothing you can do about it. Here is the WP tables shema if you want to have a look https://codex.wordpress.org/Database_Description#Table:_wp_users … Read more

Need SQL query to find&replace image URL

If you don’t have WPCLI installed, but still have commandline access or access via PHPMyAdmin, run: UPDATE wp_posts SET post_content = REPLACE(post_content,'<old URL>’,'<new URL>’); UPDATE wp_postmeta SET meta_value = REPLACE(meta_value,'<old URL>’,'<new URL>’);

SQL command to export post_content from wp_posts using phpMyAdmin

Use This Script <?php $servername = “localhost”; $username = YOUR_USER; $password = YOUR_PASSWORD; $dbname = YOUR_DB_NAME; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die(“Connection failed: ” . $conn->connect_error); } $a1 = ($_GET[‘id’]); $sql = “SELECT post_content FROM `wp_posts` where ID=’$a1′”; $result = $conn->query($sql); if ($result->num_rows > … Read more

cannot log in to the mysql server (wamp and wordpress)

The default Wamp user`s credentials are: username: root password: (empty, nothing, nada) If you already have a WordPress website previously created on your Wamp system, then go to /www/yourlocalsite/wp-config.php and check out the username and password you set. Here`s an example: /** MySQL database username */ define(‘DB_USER’, ‘root’); /** MySQL database password */ define(‘DB_PASSWORD’, ”); … Read more

Options table – where does my values go?

There is indeed an options table (wp_options / prefix_options). You can the find full details on that table here: http://codex.wordpress.org/Database_Description#Table:_wp_options Options are meant to be globally accessible (not tied to individual posts), and you only need to know the option name/key. You can access that table and its values with the following functions: <?php $your_option … Read more

tech