Plugin Directory

Test out the new Plugin Directory and let us know what you think.
!This plugin hasn’t been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

Menu Rules

An extension of the menu system with context-based rules and a flexible framework to write your own.

This plugin has been replaced by Context Manager

Context Manager does the same job as Menu Rules, but comes with many more features to save you time and unnecessary coding.

Menu Rules can run alongside Context Manager while you migrate your rules across. Speak to me on Twitter if you need any help with the transfer.

About Menu Rules

In WordPress there's no way to apply context to the menu system. Menu Rules solves this problem and gives you a framework to write your own menu extensions.

Example usage

You have an e-commerce website that has a custom post type called 'products'. You have a page that lists products which is listed in your main menu. A user visits the page and the menu item becomes 'active'. You click through to a product and the menu item loses its active state. This is how to fix it with menu rules:

  1. Install the Menu Rules plugin
  2. Add a menu rule
  3. Give it a meaningful name in the title field. This is just for administration purposes
  4. In the conditions field enter is_singular( 'product' )
  5. Choose Emulate current page as a child but do not create a menu item. as the menu rule
  6. Find your products page in the menu dropdown
  7. Hit publish

Extending Menu Rules

  1. Create a class that extends Menu_Rules_Handler and includes a handler method.
  2. Write your custom functionality
  3. Register your class using add_action( 'plugins_loaded', create_function( '', 'Menu_Rules::register( "Your_Menu_Rule_Class" );' ) );

Built-in rules are found in menu-rules/rules/


If you're stuck, ask me for help on Twitter.

Requires: 3.2 or higher
Compatible up to: 3.5.2
Last Updated: 4 years ago
Active Installs: 100+


0 out of 5 stars


Got something to say? Need help?


Not enough data

0 people say it works.
0 people say it's broken.