Tag Info

Hot answers tagged

2

When you work with any type of database it is of UTMOST importance to create regular backups. Once you delete something from a database it is gone forever. This is what they teach in the first class of any database course. Here is a link to a question in DB stackexchange I highly doubt they can do anything about it, but do contact your webhost to see if ...


2

If you're going to keep using that database for other things as well, keep it separate. But from what you're saying, you are rather trying to expand functionality for it within the site, so better integrated. There are a lot of things you can do with a database even from within WP anyway.


2

You can use plugins such as BackupBuddy, but I prefer to script this and use wp-cli, which reads wp-config.php and means you don't have to worry about mysql credentials. wp-cli allows you to: export the db: wp db export <filename> import the db: wp db import <filename> safe search and replace (including serialised data): wp search-replace ...


1

WordPress uses a prefix by default just in case the database is being used by more than WordPress. Since creating a new DB is pretty simple I would go that route. You would get the potential benefit of it being something separate that you can easily export, import or blow away if needed and also the potential security benefit if your WP site gets hacked this ...


1

Use the following functionto set views manually function setPostViewsManually($postID, $viewCount) { $count_key = 'post_views_count'; $count = get_post_meta($postID, $count_key, true); update_post_meta($postID, $count_key, $viewCount); } You can run this code by <?php setPostViewsManually(get_the_ID(), 1234); ?> The above code will ...



Only top voted, non community-wiki answers of a minimum length are eligible