Title: Nav Menu Trim
Author: thingsym
Published: <strong>1 August 2017</strong>
Last modified: 2 June 2026

---

Search plugins

![](https://s.w.org/plugins/geopattern-icon/nav-menu-trim.svg)

# Nav Menu Trim

 By [thingsym](https://profiles.wordpress.org/thingsym/)

[Download](https://downloads.wordpress.org/plugin/nav-menu-trim.1.2.5.zip)

 * [Details](https://en-gb.wordpress.org/plugins/nav-menu-trim/#description)
 * [Reviews](https://en-gb.wordpress.org/plugins/nav-menu-trim/#reviews)
 *  [Installation](https://en-gb.wordpress.org/plugins/nav-menu-trim/#installation)
 * [Development](https://en-gb.wordpress.org/plugins/nav-menu-trim/#developers)

 [Support](https://wordpress.org/support/plugin/nav-menu-trim/)

## Description

Nav Menu Trim plugin trim html id/class attributes of Nav Menu.

#### Support

If you have any trouble, you can use the forums or report bugs.

 * Forum: [https://wordpress.org/support/plugin/nav-menu-trim/](https://wordpress.org/support/plugin/nav-menu-trim/)
 * Issues: [https://github.com/thingsym/nav-menu-trim/issues](https://github.com/thingsym/nav-menu-trim/issues)

#### Contribution

Small patches and bug reports can be submitted a issue tracker in Github. Forking
on Github is another good way. You can send a pull request.

Translating a plugin takes a lot of time, effort, and patience. I really appreciate
the hard work from these contributors.

If you have created or updated your own language pack, you can send gettext PO and
MO files to author. I can bundle it into plugin.

 * [VCS – GitHub](https://github.com/thingsym/nav-menu-trim)
 * [Homepage – WordPress Plugin](https://wordpress.org/plugins/nav-menu-trim/)
 * [Translate Nav Menu Trim into your language.](https://translate.wordpress.org/projects/wp-plugins/nav-menu-trim)

You can also contribute by answering issues on the forums.

 * Forum: [https://wordpress.org/support/plugin/nav-menu-trim/](https://wordpress.org/support/plugin/nav-menu-trim/)
 * Issues: [https://github.com/thingsym/nav-menu-trim/issues](https://github.com/thingsym/nav-menu-trim/issues)

#### Patches and Bug Fixes

Forking on Github is another good way. You can send a pull request.

 1. Fork [Nav Menu Trim](https://github.com/thingsym/nav-menu-trim) from GitHub repository
 2. Create a feature branch: git checkout -b my-new-feature
 3. Commit your changes: git commit -am ‘Add some feature’
 4. Push to the branch: git push origin my-new-feature
 5. Create new Pull Request

#### Contribute guidlines

If you would like to contribute, here are some notes and guidlines.

 * All development happens on the **develop** branch, so it is always the most up-
   to-date
 * The **master** branch only contains tagged releases
 * If you are going to be submitting a pull request, please submit your pull request
   to the **develop** branch
 * See about [forking](https://help.github.com/articles/fork-a-repo/) and [pull requests](https://help.github.com/articles/using-pull-requests/)

#### Test Matrix

For operation compatibility between PHP version and WordPress version, see below
[Github Actions](https://github.com/thingsym/nav-menu-trim/actions).

## Screenshots

[⌊Appearance > Customize > Menus⌉⌊Appearance > Customize > Menus⌉[

Appearance > Customize > Menus

[⌊Nav Menu Trim options⌉⌊Nav Menu Trim options⌉[

Nav Menu Trim options

## Installation

 1. Download and unzip files. Or install **Nav Menu Trim** using the WordPress plugin
    installer. In that case, skip 2.
 2. Upload **nav-menu-trim** to the “/wp-content/plugins/” directory.
 3. Activate the plugin through the ‘Plugins’ menu in WordPress.
 4. Configure settings through the **Appearance > Customize > Menus > Nav Menu Trim**
    menu in WordPress.
 5. Have fun!

#### Filter hooks

 * nav_menu_trim_get_options
 * nav_menu_trim_get_option

## Reviews

There are no reviews for this plugin.

## Contributors and Developers

“Nav Menu Trim” is open source software. The following people have contributed to
this plugin.

Contributors

 *   [ thingsym ](https://profiles.wordpress.org/thingsym/)

[Translate “Nav Menu Trim” into your language.](https://translate.wordpress.org/projects/wp-plugins/nav-menu-trim)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/nav-menu-trim/), check
out the [SVN repository](https://plugins.svn.wordpress.org/nav-menu-trim/), or subscribe
to the [development log](https://plugins.trac.wordpress.org/log/nav-menu-trim/) 
by [RSS](https://plugins.trac.wordpress.org/log/nav-menu-trim/?limit=100&mode=stop_on_copy&format=rss).

## Change Log

#### 1.2.5

 * tested up to 7.0
 * change requires at least to wordpress 5.9
 * change requires to PHP 7.4
 * fix test case
 * fix plugin_textdomain rel path
 * add phpcs job
 * update github workflows
 * update phpunit v9 and wpcs v3
 * update composer dependencies
 * update wp-tests script

#### 1.2.4

 * tested up to 6.2.0
 * fix composer scripts
 * update github actions
 * fix load_textdomain method for testability
 * add msgmerge to composer scripts
 * add support section and enhance contribution section to README
 * fix license

#### 1.2.3

 * add composer script
 * remove makepot:php composer script
 * change makepot from php script to wp cli
 * change plugin initialization to plugins_loaded hook
 * replace assert from assertEquals to assertSame

#### 1.2.2

 * fix wp-plugin-unit-test.yml
 * add Upgrade Notice
 * change requires at least to wordpress 4.9
 * change requires to PHP 5.6
 * bump up yoast/phpunit-polyfills version
 * update wp-plugin-unit-test.yml
 * change os to ubuntu-20.04 for ci
 * add wp-plugin-unit-test-matrix.yml

#### 1.2.1

 * add test case for customizer
 * update composer dependencies
 * change from protected variable to public variable for unit test
 * add timeout-minutes to workflows
 * add phpunit-polyfills
 * tested up to 5.8.0

#### 1.2.0

 * tested up to 5.7.0
 * add composer scripts
 * update japanese translation
 * update pot
 * add test case
 * change constant name
 * add sponsor link
 * add FUNDING.yml
 * add donate link
 * update wordpress-test-matrix
 * add GitHub actions for CI/CD, remove .travis.yml

#### 1.1.2

 * rename sanitize_callback function from sanitize_checkbox to sanitize_boolean
 * fix indent and reformat with phpcs and phpcbf
 * add composer.json for test
 * add static code analysis config

#### 1.1.1

 * fix access modifier
 * fix tests
 * fix PHPDoc comment
 * fix filter nav_menu_trim_get_options and nav_menu_trim_get_option
 * change to add_action with load_textdomain
 * add sanitize_checkbox

#### 1.1.0

 * update screenshot
 * fix PHPDoc comment
 * remove $languages_path
 * fix .travis.yml
 * fix tests
 * add nav_menu_submenu_css_class function
 * fix get_options function
 * add default_options
 * fix load_textdomain

#### 1.0.2

 * fix tests
 * fix data validation via wp_kses
 * change output css to here document
 * fix option detect
 * change add_filter from plugin_action_links to plugin_action_links_{$plugin_file}
 * add init function
 * fix codesniffer.ruleset.xml

#### 1.0.1

 * fixed: fix .travis.yml
 * fixed: fix trim_css_class function
 * fixed: check exists class

#### 1.0.0

 * initial release

## Meta

 *  Version **1.2.5**
 *  Last updated **4 months ago**
 *  Active installations **Fewer than 10**
 *  WordPress version ** 5.9 or higher **
 *  Tested up to **7.0.7**
 *  PHP version ** 7.4 or higher **
 *  Language
 * [English (US)](https://wordpress.org/plugins/nav-menu-trim/)
 * Tags
 * [menu](https://en-gb.wordpress.org/plugins/tags/menu/)[nav](https://en-gb.wordpress.org/plugins/tags/nav/)
 *  [Advanced View](https://en-gb.wordpress.org/plugins/nav-menu-trim/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/nav-menu-trim/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/nav-menu-trim/reviews/)

## Contributors

 *   [ thingsym ](https://profiles.wordpress.org/thingsym/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/nav-menu-trim/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](https://github.com/sponsors/thingsym)