WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The scenario is like, I have two servers:

  • Server A : Hosts WordPress
  • Server B : Hosts Some PHP Scripts

Now, I want to load the wordpress menu on server B. Is there any way to achieve this? Couldn't find anything helpful.

I have a plan like this, so far:

  • Save the complete output of wp_nav_menu() in the wordpress option table
  • From Server B, connect to wordpress database remotely and get the value of the menu from option table, and print that on the PHP page, wrapping with css from the wordpress theme.

Is there any good approach than what I have planned?

share|improve this question
That's about as good as it gets. There is no API or anything to server menus remotely. – Rarst Jul 12 '14 at 14:13
Another option for anyone in a similar situation but unable to connect to the database remotely would be to save the output of wp_nav_menu() to a publicly available html file and include it on Server B using file_get_contents (assuming allow_url_fopen is enabled on Server B). – karpstrucking Jul 12 '14 at 18:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.