The 3 thing that make you have the best experience with WordPress

Currently, WordPress is a popular platform to write articles. It is very convenient and easy to use. But we could do more thing to make writing become comfortable. There are 3 thing that I encounter to make it more helpful.

1) The customize css effect can not show while wring the post, it can show up only in published articles. To make the customize css visual effect can be show in post editing page, add those lines of code into your theme folder functions.php file.

function myplugin_custom_css_editor() {
    // Get the Custom CSS value
    $custom_css = wp_get_custom_css(); // WordPress 4.7+

    if ( ! empty( $custom_css ) ) {
        // Add inline style to block editor
        wp_add_inline_style( 'wp-block-editor', $custom_css );
    }
}
add_action( 'enqueue_block_editor_assets', 'myplugin_custom_css_editor' );

2) WordPress auto save feature will save a lots of copy with the same article. If you write a post for an hour, there will be several hundreds of version existing in the database. If you write one hundred post on your site, there a lots of items in your database. Too many data will take lots of hard disk space, and make your website become slow. Usually saving the latest 3 or 5 version of your article is enough, in my opinion.

To the limit the auto save maximin version, add following line of code into wp-config.php which locate in the root of WordPress folder.

define('WP_POST_REVISIONS', 5); // Keep only the last 5 revisions

💡 3) Emoji can not be added into your articles. This is caused by the character set. You need to make sure database | table | column character set is utf8mb4. More specifically, take utf8mb4_unicode_ci for them will be ok. Just as following image show.