Back to blog
5 min read Export Guides

Export and Import WordPress Menus: Move a Menu to Another Site

Rebuilding a navigation menu by hand on a new site is slow and error-prone: dozens of items, sub-menus, custom links and the right pages behind each label. WordPress’s own exporter can include menus only together with all posts and pages, as a WXR file. With Import Export by RockStarLab PRO, you export just the menu to a JSON file and import it on the other site, where its items are linked to the pages and categories that already exist there. In the example, a coffee roastery’s header menu moves to a new site.

PRO: menu export and import are part of PRO. Free: posts, pages, comments and media, including the pages your menu links to.

Short Answer

  1. On the old site, go to Export, choose Menus, add the filter Menu Name Equals your menu, and export all five fields as JSON.
  2. Make sure the pages and categories the menu links to exist on the new site.
  3. On the new site, go to Import, choose Menus, upload the file, click Auto Map and start the import. Then assign the menu to a location in Appearance → Menus.

Export the menu

Each menu is one row in the export. A filter on Menu Name picks the one you need; without a filter you get every menu on the site.

Menu export filter: Menu Name Equals Roastery Header; total items available 1
One filter picks the menu to export.

The menu export has five fields: Source Menu ID, Menu Name, Theme Locations, Items Count and Menu Items, which holds every item as JSON. Choose JSON as the format so the items stay readable. Our “Roastery Header” had six items:

  • Home, Services and Blog: pages.
  • About Us (a page) and News (a category), both under Services.
  • Online Shop: a custom link to the shop on its own domain, opening in a new tab.

Part of the exported file:

[
  {
    "term_id": 233,
    "name": "Roastery Header",
    "locations": "",
    "count": 6,
    "menu_items": [
      …,
      {
        "ID": 2047,
        "title": "About Us",
        "url": "https://www.example-roastery.com/about-us/",
        "menu_item_parent": "2046",
        "type": "post_type",
        "object": "page",
        "object_path": "about-us",
        "target": ""
      },
      {
        "ID": 2050,
        "title": "Online Shop",
        "url": "https://shop.example-roastery.com/",
        "menu_item_parent": "0",
        "type": "custom",
        "object": "custom",
        "target": "_blank"
      }
    ]
  }
]

Next to each page item the file stores the page’s path (object_path), and next to each category the term’s slug. That’s how the import finds the right page on the new site, even when its ID is different.

Import it on the new site

Move the pages first, if the new site doesn’t have them yet (see moving content with its slugs). Then, in Import, choose Menus, upload the JSON file and click Auto Map:

Menu import mapping on the new site: term_id, name, locations, count and menu_items mapped automatically, 5 of 5 fields mapped
Auto Map maps all five menu columns.

On the options step we left Check for Existing Items by Field empty, so the import created a new menu.

The result on the new site:

Appearance Menus on the new site: Roastery Header with Home, Services, About Us and News as sub items, Blog, and Online Shop custom link to https://shop.example-roastery.com/
The imported menu: same order and sub items, and the external shop link unchanged.
  • All six items arrived in the same order, with About Us and News under Services.
  • About Us has a different page ID on the new site. The import found it by its path, about-us, and linked the item to the new page.
  • Home, Services and Blog link to the pages on the new site, and News to the new site’s category.
  • Online Shop kept https://shop.example-roastery.com/ and its new-tab setting. Custom links that pointed to the old site’s own pages are moved to the new site’s address.

Our menu had no theme location on the old site, so we assigned one under Menu Settings after the import. The locations depend on the theme, so check them on every new site.

When a page doesn’t exist on the new site

If the import can’t find the page or category an item points to, the item is kept as a custom link, so the menu stays complete. Check those items afterwards and either create the missing page or point the item to another one.

Before you import

Importing a menu adds or changes menus on the new site; it doesn’t touch pages or posts. Still, back up the site before larger imports, and keep the exported JSON file as a copy of the menu.

With an AI agent

An AI agent connected through the WordPress MCP Adapter (see connecting Claude Code to WordPress) can check the menu after the import:

Show me the items of the Roastery Header menu with their links.

In our run on the new site, the agent called rsl-ie-pro/export-preview for the menu. It returned six items: About Us under Services, pointing to the new page with its new ID, five links on the new site’s address, and Online Shop with https://shop.example-roastery.com/ and the target _blank.

FAQ

Can I export all menus at once?

Yes. Leave out the Menu Name filter; each menu becomes one row in the file.

Does it work with block themes and the Navigation block?

No. This exports classic menus from Appearance → Menus. A Navigation block stores its links in the block itself.

What’s the difference from syncing menus?

Export and import work with a file and need no connection between the sites. To keep menus in step between two connected sites, see syncing menus between sites.

Can I use CSV instead of JSON?

Yes, but the Menu Items column is JSON either way, so a JSON file is easier to read and edit.

Get the free plugin on WordPress.org.

Dmitriy
About author

Dmitriy

WordPress Developer with 15+ years of commercial experience. Elite Author on ThemeForest and creator of custom WordPress plugins. Passionate about clean code, performance optimization, and building useful tools for the WordPress community.

JOIN THE CONVERSATION

Comments 0

Have a question or a tip to share? Leave it below.

Leave a comment

Your email address will not be published. Required fields are marked *

We store your name, email and comment to show and moderate it; your email is never published. Spam protection is provided by Cloudflare Turnstile and profile pictures by Gravatar. See our Privacy Policy.


Try the plugin with no risks!

New users get 1 month with access to all premium features. Experience the most powerful WordPress data engine today.

Download Now
Get PRO for FREE