Reset/Reorder posts ID in the MySQL wp_posts table

If you want sequential numbers for your posts, then don’t use the post ID column. AUTO_INCREMENT is meant to provide unique numbers (and split-brains in multi-master replication), it is never going to be without gaps, especially not in WordPress (revisions, autosaves, pages, contact forms, galleries and a bunch of other plugins) and especially not with … Read more

How do I properly update the WordPress database password?

This is technically challenging. WordPress must have access to your DB password in plain text. Having access to the wp-config.php contents is already a breach of security in progress. There are alternate approaches to configuration, such as loading credentials via environment variables, but in practice they are used exceedingly rarely because PHP’s configuration file is … Read more

WP Database Table to CSV file

You’ve got a few things wrong. The first is that you are clearly in WordPress context. You should be using the AJAX API for this rather than including wp-load.php. That is virtually never the right way to do it. get_results() defaults to an object, so you are going to get errors when you try to … Read more

Custom User Profile Fields

You’re going to definitely want to do this with a plugin. Modifying WordPress Core files is an extremely bad idea as others have pointed out because every update will wipe them out and future versions may change the location/function of what you’re editing. You can get away by adding it to the theme’s functions.php file … Read more

How to generate page content from database the right way?

WordPress is fetching current post for you, you have to only type to the right url. When you get e.g. to example.com/lorem-ipsum/ WordPress will load automatically post with title Lorem ipsum and display it using page.php template. Your page.php template should be looking something like that. <?php get_header(); ?> <div id=”content”> <?php while ( have_posts() … Read more