Title: Schema Markup
Last modified: August 21, 2016

---

# Schema Markup

 *  Resolved [csttech](https://wordpress.org/support/users/csttech/)
 * (@csttech)
 * [12 years ago](https://wordpress.org/support/topic/schema-markup/)
 * I see in the element container options it only lets you select nav or div. One
   thing I tried is putting the schema next to nav hoping it would all be wrapped
   in < > but that didn’t work.
 * I tried looking in the php file for where the nav code is generated to add itemscope
   =”itemscope” itemtype=”[http://www.schema.org/SiteNavigationElement&#8221](http://www.schema.org/SiteNavigationElement&#8221);
 * Each item has the correct markup, I just need to wrap the whole menu in that 
   somehow
 * [https://wordpress.org/plugins/custom-menu-wizard/](https://wordpress.org/plugins/custom-menu-wizard/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [wizzud](https://wordpress.org/support/users/wizzud/)
 * (@wizzud)
 * [12 years ago](https://wordpress.org/support/topic/schema-markup/#post-4910733)
 * CMW’s **container** option is intended to take a tag, because that’s what _wp\
   _nav\_menu()_ handles.
 * The tags that _wp\_nav\_menu()_ accepts can be modified from the defaults (“div”
   or “nav”) by using a filter – “wp_nav_menu_container_allowedtags” (ref: _wp\_nav\
   _menu()_ in wp-includes/nav-menu-template.php) – but that filter receives nothing
   that lets you know whether wp_nav_menu() is processing a CMW menu or some other
   menu (should you need to be able distinguish).
 * An alternative might be to hook into _wp\_nav\_menu()_‘s “wp_nav_menu” filter.
   For example…
 *     ```
       add_filter( 'wp_nav_menu', 'my_cmw_nav_menu_filter', 10, 2 );
       function my_cmw_nav_menu_filter( $nav_menu, $args ){
           if( !empty( $args->_custom_menu_wizard )
                   && !empty( $args->_custom_menu_wizard['container'] ) ){
               $nav_menu = preg_replace(
                   '/^<(' . $args->_custom_menu_wizard['container'] . ')/',
                   '<$1 itemscope="itemscope"',
                   $nav_menu
                   );
           }
           return $nav_menu;
       }
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Schema Markup’ is closed to new replies.

 * ![](https://ps.w.org/custom-menu-wizard/assets/icon-256x256.png?rev=1381901)
 * [Custom Menu Wizard Widget](https://wordpress.org/plugins/custom-menu-wizard/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-menu-wizard/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-menu-wizard/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-menu-wizard/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-menu-wizard/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-menu-wizard/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [wizzud](https://wordpress.org/support/users/wizzud/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/schema-markup/#post-4910733)
 * Status: resolved