Improve page speed by letting slim down the HTML code of menus and category lists to the only CSS classes and attributes your theme needs.
Improve page speed by letting slim down the HTML code of menus and category lists to the only CSS classes and attributes your theme needs.
The plugin is available in English, Spanish (Español) and German (Deutsch).
This plugin deletes the CSS classes you do not need in a navigation menu, page menu and category list. It slims down the HTML code of WordPress menus and category lists to the only neccessary CSS classes you want for your theme. This results in less HTML code and thus in higher page speed.
If you are very concerned about the loading time of your website and you do not manage to gain seconds or tenths in the loading of the site with 3rd party caching plugins, you may find it interesting to experiment with the plugin Purify WordPress Menus and evaluate its possibilities.
You want to test Purify WordPress Menus before installing on your site? Try it out on your free dummy site and click here.
The visual appearance of menus and category lists in the frontend remains unchanged in most cases. If you should see an undesirable visual effect to the menus and category lists in your theme, then you can activate the needed CSS classes on the plugin’s options page.
If you deactivate the plugin, your settings remains. If you activate the plugin again, your last settings will be used. You do not need to go over all settings again.
If you delete the plugin via the WordPress ‘Plugin’ menu, your settings will be deleted, too. No useless option remains in the WordPress database.
The default setting is to output only the CSS classes for the navigation menu items of the current post and the current category.
If activated by yourself, then items which are parents of the current item will not be classified as ancestors additionally. You can set that separately for both menus and category lists.
This plugin filters out the old CSS classes of page menus in navigation menus. Using the WordPress menu configurator the page menu classes are not necessary anymore.
This plugin deletes the ID attribute of each menu item. In most cases the ID of every menu item is not needed.
This plugin filters out the CSS classes of each item in category lists.
This plugin hooks into the WordPress core functions wp_nav_menu()
, wp_page_menu()
and wp_list_categories()
. It changes the results of those functions to the settings you have done.
You can:
wp_nav_menu()
, wp_page_menu()
and wp_list_categories()
generatePurify WordPress Menus is available in multiple languages maintained by the amazing WordPress community.
Your language is missing? Please be part of the community and help to translate Purify WordPress Menus on GlotPress. Thank you!
The first screenshot shows a sample of the results of the HTML output of wp_nav_menu()
before and after activating the plugin.
The second screenshot shows a part of the plugin's option page in the german language.
The third screenshot shows where you can find the link to the plugin's option page in the german version of WordPress.
Yes, it does.
Short answer: Normally not and if yes, you can take control of it.
Long answer: The default settings print out only the CSS class for the active menu items of the current post, page or current category. If the theme’s CSS uses also the other CSS classes and/or item ID attributes you will notice some undesirable visual effects on menus and category lists. In this case just find out which classes and/or IDs the theme uses and activate them via the plugin’s options page until the effects disappear.
After activating the plugin deletes the id attributes an all CSS classes on every menu item except the CSS classes .current-menu-item
in navigation menus and .current_page_item
in page menus.
Your settings will be still stored in the WordPress database. After you re-activate the plugin, all your settings are back.
Your settings will be deleted, too. In other words: There would not remain any useless settings of this plugin.
Yes. It does this way as default. You can activate the output of every menu item’s id on the plugin’s options page.
Normally, if you deselect every checkbox for page menus on the plugin’s option page, no class attribute should be there in page menus. But the WordPress files do not offer a gentle way to suppress the class attribute if it has no values. The plugin saves time and ressources by not trying an own way. If you would have a trick for deleting the empty class attibute with little effort, then please tell me about it.
The translations are handled on WordPress.org. Please be part of the community and help to translate Purify WordPress Menus on GlotPress. Thank you!
Successfully tested with WordPress 4.1, especially with the revised filters ‘nav_menu_css_class’ and ‘nav_menu_item_id’
Successfully tested with WordPress 4.0