Revision featured image

The featured image is saved as postmeta, and by default, postmeta is not stored in revisions. This means that if anyone removes the featured image and saves (updates) their post, that postmeta is removed and not associated to the post anywhere. If you need to modify this behavior for the future, you can programmatically enable … Read more

Disable autosave with `function.php` for custom post wordpress?

There are a few methods to disable autosave/revisions. Disabling autosave: Using action and dequeuing the .js that is responsible for autosave, this goes into functions.php, located in the current theme directory. function bt_disable_autosave () { wp_deregister_script(‘autosave’); } add_action(‘admin_init’, ‘bt_disable_autosave’); Using a constant to set the interval so high (one day) it will never happen unless … Read more

How to reduce the number of revisions?

You can use define (‘WP_POST_REVISIONS’, 2); in wp-config.php for two revisions, and you could turn that into your own plugin. Manully remove all revisions with this query run in phpmyadmin: DELETE a,b,c FROM wp_posts a LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id) LEFT JOIN wp_postmeta c ON (a.ID = c.post_id) WHERE a.post_type=”revision” and then … Read more

Revisions function ¿disabled?

It’s not a good idea to run old versions of WordPress. Fortunately, you can quite easily turn off post revisions by using the wp_revisions_to_keep filter. Add the following code snippet to a plugin, or to your active theme’s functions.php file: add_filter( ‘wp_revisions_to_keep’, ‘wpse_368635_disable_revisions’ ); function wpse_368635_disable_revisions( $revisions ) { // Setting the value to 0 … Read more

Delete post revisions only for a single post

If you need an SQL query, then this option should be suitable function src_flush_revisions () { global $wpdb; $post_id = 5//exp post id if ( isset( $timeLimit ) ) { $revision_ids = $wpdb->get_col( $wpdb->prepare( “SELECT `ID` FROM $wpdb->posts WHERE `post_type` = ‘revision’ AND `post_parent` = %d”, $post_id ) ); foreach ( $revision_ids as $revision_id ) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)