You will need to convert the relative links to absolute links. You can do this in the wp_nav_menu_objects
filter, which gets all menu items. Just edit the url
property of each item.
Another option would be to extend the default Walker_Nav_Menu
with one that overrides start_el()
, so you can modify the passed $item
there before you pass it to the parent start_el()
.
These are relative links you added yourself? If you add a link to a WordPress Page or Post via the menu editor it should be absolute by default.
Related Posts:
- WordPress links https overwrite issue
- Why is wordpress forcing https link generation?
- bloginfo(); outputs wrong urls without https on inner pages
- Site migration and how to write internal links with migration in mind
- Link rewrite to https (NOT URL rewrite)
- Get parent page url to show up when it is in child pages
- Why is there a link tag with rel “profile” pointing to gmpg.org?
- How to use wpLink without editor?
- Add CSS Class to Link in TinyMCE editor
- How to print translation supported text with HTML URL
- Add custom menu item using wp_nav_menu_items filter
- Get the prev / next page links only (not title, etc)
- How to re-enable the links manager?
- Removing link ” from ” menu for some “links” without JS
- Wondering how to turn your firefox bookmarks into a WordPress blog?
- How can I link to the most recent post in a category?
- Links redirecting to localhost after migration to server
- Is it possible to link to draft pages?
- How can I find all internal links that are pointing to post/page?
- Using filters to change href of nav menu page link
- Creating a Link Directory using WordPress?
- Count and show Clicks on external links in a single page/post
- How to use wp_rel_nofollow to add nofollow to external links only?
- get_category_link() is returning nothing
- Links open only on new tab or window
- Is there any way to set default for “Insert/Edit Link” to “Open link in new window”?
- root-relative links for multiple parked domains
- Get link value only from the_content()?
- How to get current page menu item name instead of full menu item list
- How to splice in wp_links links into the loop?
- widget to output a link to archive view
- Is there an easy way to create a links index page?
- Can’t add a class to links in the visual editor since WP 3.1?
- What is the canonical way to link to pages?
- how can i add a menu link that goes to an external page
- Remove all links to a specific website
- Adding different classes to anchor in navigation menu
- How do I remove or disable “Or link to existing content” in “insert link” dialogue?
- Retrieving all Links from a Post?
- Link Category Description
- Auto-embed link info from URLs in link post format?
- programatically change href to onclick=window.open
- Disable automatic content hyperlinking
- Open link in a new tab checked by default when adding a new link in visual post editor
- Deep linking to an accordion tab with Visual Composer
- Setting a page link in the footer?
- How to add/change a value of $wpdb property/var?
- Pending Custom Link in Menu
- Need advice on how to add links in users profile page?
- Generate Random Post Links Somewhere in the post
- How to hide a customization link themes menu in wordpress?
- Getting only the most recent bookmark?
- WordPress links/bookmarks – need to urlencode because spaces are getting stripped
- Custom Post Type archive link in WYSIWYG editor
- Add Link Text Back to Insert/edit link Box
- Force PDF download from custom menu?
- How to list all external URLs that I have posted on my WordPress blog?
- How do I make my navigation bar link to an external page?
- Plugin that inserts favicon next to links
- Page-Linking Structure
- Create anchor from Wysiwyg editor
- Is there any way of changing the post order via user click?
- Get post / page ID from ACF Link field
- Creating a navigation link to my front-page
- How to remove author name and link from a shared link preview?
- wp_get_attachment_link to add title attribute to link tag around image
- How to add wechat (weixin) link to navigation menu?
- Can I generate then display a mixed list of linked and unlinked terms
- Relative links for performance?
- Make page tab link to pdf
- Admin only menu/page
- Dont’t change active Button while I’m listing a category?
- How to change server name on WordPress Installation?
- How to prevent a page from being linked in the menu/crossbar
- How do i set the read more link?
- Plugin for wikipedia style references in WP?
- Problem creating an edit link for a custom post type
- Image as a link using wp_nav_menu()
- How to convert all links to no follow links of particlular section of a webpage
- Linking from Menu and a Page to the latest post from a specific category
- Link that refers to a menu item with dynamically generated URL
- Fragment URL in navigation item without a custom link
- Link to Homepage in Menu
- After duplicating site to a sub folder, links send user to original site
- Automaticly replace a link with other “new link”
- Links are not working on All Plugins Page
- How to add a WordPress page with multiple picture links?
- Enumerating over a category of links
- Separator for custom nav menu
- Is there a way to hide WordPress behind a web visible directory?
- Twitter links in widget don’t work?
- Links in nonalphabetic order
- Class active for Archive link – looped out
- Copy button for anchor link
- How do you link to a place in another page without any styling issues?
- How to automatically nofollow a set domains? (I seem to have half of the answer)
- My custom link works only on home page
- Custom Links menu items include in Search Results
- Menu custom link not working for external site
- Read more link to external webpage