📜 ⬆️ ⬇️

Some WordPress Optimization Tips

A few little things that will help your blog work faster if the hosting service swears at you. Maybe you already know them, but as it turns out, not everyone knows and uses.

I once had a post about how to optimize a Wordpress theme to make it work faster. But these are little things that are better left for later, for sweets.

* Optimization starts from the database. Need to optimize the table. Go to phpMyAdmin, select our database and then:
Table optimization
')
This will help the database server to work with tables more quickly, which will slightly reduce the load. In earlier versions of phpMyAdmin there may be no “Mark Required Optimization” item. Then simply select all the tables and do with the marked "Optimize".

* We get rid of all unnecessary plugins, and especially those that are not compatible with this version of CMS. Very often, these plug-ins do not work correctly.
* We remove absolutely unnecessary things from theme 3: the engine version and, if you do not plan to use Windows Live Writer, then the manifest. Add 3 lines of code to the functions.php file:

<?php remove_action('wp_head', 'wp_generator'); ?>
<?php remove_action('wp_head', 'wlwmanifest_link'); ?>
<?php remove_action('wp_head', 'rsd_link'); ?>

* Turn off revisions of records without a plugin. We add the following line to the wp-config.php file:

define ('WP_POST_REVISIONS', false);

To delete existing revisions (if you don’t know how, it’s better not to climb):
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'


* Install WP Super Cache plugin (or enable it if it is in your assembly of the correct Russian Wordpress)
* In wp-config.php instead of define ('WPLANG', 'en_RU'); write down:

if (strpos($_SERVER['REQUEST_URI'], 'wp-admin'))
define ('WPLANG', 'ru_RU');
else
define ('WPLANG', 'ru_RU_lite');


This is stated in the file "READ MANDATORY BEFORE INSTALLATION.html" in the distribution of the correct Russian Wordpress.

* Theme. Check it out for plugins like Popular Posts, Similar Posts. You can get rid of all this and write your own code for processing information. ( more info )

Maybe you know any other methods? Write, try.

Source: https://habr.com/ru/post/66669/


All Articles