WordPress.org

Support

Support » How-To and Troubleshooting » Relative URLs in WordPress nav menus

Relative URLs in WordPress nav menus

  • I’d like to save a relative URL to a WordPress nav menu.

    So I enter “link-url” as the URL I want to save but it gets saved as “http://link-url”

    How do I prevent it from saving with the “http://” prepended to it?

    My hack so far is to prepend the value with “relative|” and when the menu is being output I do a PHP str_replace on the “http://relative|” removing it, but I would like it if WordPress just trusted my input and didn’t force “http://”

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator kmessinger

    @kmessinger

    I guess you know wp does not like relative urls. There are solutions, maybe a plugin – it has been talked about a lot. Search relative+url

    @kmessinger, Not finding much on this topic.
    I see a lot about relative URLs but not the nav menu items created in “Appearance > Menus”

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Relative URLs in WordPress nav menus’ is closed to new replies.
Skip to toolbar