WordPress always uses the full URL when it inserts a link. There are a number of reasons for this, and they are all good reasons.
You can add relative URLs yourself by simply typing your own links and omitting the domain portion of the link.
So http://sitename.tld/cool-page
becomes /cool-page
.
As I said, though, this is not the best practice to develop. it creates a lot of potential for ambiguity and inefficiency.
Here are a couple of links for reasons to not do that and just use the tools WordPress offers you instead.
https://yoast.com/dev-blog/relative-urls-issues/
https://moz.com/blog/relative-vs-absolute-urls-whiteboard-friday
Related Posts:
- How to bulk Update URLs to new values?
- Access post from post id in URL
- How to add category to: ‘wp-admin/post-new.php’?
- How to Check if a Page Exists by URL?
- Strategy for handling hierarchical pages with empty parent content
- Open WordPress ‘Add New Post’ admin page with parameters set via $_GET
- How do you get all the urls of images attached to a post?
- How to allow slashes in single posts when i click in the edit permalink button
- Possible to create a permalink to sort with meta_key?
- how to grab first link in post… and of course call it
- How can I extract the URL of a link from a post?
- Create a separate JS application for an individual post?
- Remove slashes (both before and after) in relative post url
- Random post category URL
- Paginated Posts – Social Media Buttons Share First Page URL
- WordPress not opening posts with only numbers if permalink is post_name
- Assign category to new post via URL
- filter RSS feed in URL
- Permalink doesn’t get displayed in Twitter button (Local WordPress problem?)
- Retrieve post ID from “querying” URL
- Start post pagination at 0 instead of 1
- How do I Redirect a WordPress Page?
- WP move posts to different path
- Make insterted image point to post url instead of attachment page
- Post is blank when I click on the link
- How to get the latest URL of my blog?
- Inserting Media to WordPress Posts
- Custom Post Type, post-formats associated to custom post type > 404 archives
- Can Permalink structure of %postname%/%post_id% improve performance
- How to prevent to create same url of post, if the previous was deleted?
- Can I show category name in url for only one of my categories?
- WordPress posts have a different URL to the index
- Posting to WP via URL
- Permalink Short code showing unnecessary link text inside the loop
- Every time I try accessing a post it redirects me to the feed
- How can I make a post sub link?
- Does having category name in permalinks affect SEO when having a post in multiple categories?
- How to add a ‘News’ section to specific posts in WordPress
- Template for displaying CPT / Taxonomy URL issues
- Change WordPress names duplicate titles (url)
- How to generate an HTML link automatically from URL in a users’ post
- Prevent Archive URLs
- Category URL to use same string as Post URL Permalink
- Querying posts from current category, using a variable as array argument
- If I moved the location of my generic “posts” page, do I need to change the slugs for all of the individual posts?
- Multipage Post URL correction
- Post & Category Archives URL structure
- Post URL duplication adds numerical value
- WordPress URL question
- Embed image in post from external url
- structure of posts and pages
- How to change post template via url?
- How to retrieve a post by inputing the url in a custom field and displaying it on an options page
- Post as frontpage – avoid duplicate content
- Custom URL Structure for posts with subcategories
- How can I display a specific number of post in a category via a url
- Is there a Standard Format for Clean URLs for Archives of Custom Posts?
- Create custom URL with different levels
- Moving Posts to a new site and maintaining URLs
- Make Show Notes for Individual Podcast Episodes Easy to Find (multiple URL’s?)
- Rewrite a specific Post Format to URL slug
- Change the default video URL in a post to shortcode format
- Choose options via url
- Default post type doesn’t display in url
- Do I need to create a multisite for querying posts from multiple WordPress sites?
- Post page still linked to old site
- Blog posts are not appearing as subs of Blog Page
- How to add paraent in Blog post URL in wordpress
- Where is the old post permalink slug stored?
- Keyboard shortcut for updating a page or post?
- Categories box not showing on post edit pages
- Removing the title attribute from links in the post content
- Some posts returning 404 instead of displaying post
- Custom function for “Submit for Review” hook
- If specific user role then sticky post
- Can’t get the_content of the parent page from its single post?
- How do I Show ALL posts for Catagories and Tags?
- Classic editor throws 403 error based on post content
- How to build a site with a map that shows where people offer and need help?
- Publish post’s date is set to Nov 30 -0001
- WP_Query: Mixing category__in and tag__in together
- Fix existing media names with accents
- How to display excerpt post on hamepage and archive pages?
- Worpdress function for difference dates
- Problems with Page Not Found
- Change post-slug using wordpress API? Change permalink of a post using php / jquery?
- How to create a second posts page which client can update
- Form to post new post with custom taxonomies
- All Posts Linking to Author Posts directly
- Get latest author posts inside the loop
- How to repeat a loop after 4 posts [duplicate]
- How to show beneath posts the full category path?
- User friendly news section in WordPress without using posts
- How to assign a post to a post parrent?
- Bulk update published posts date randomly using wp-cli?
- How do I set content in my pages so that it remains permanent while blog posts are added below?
- how to redirect page after delete post inside a post page?
- Custom fields in normal posts
- Ordering posts alphabetically by meta keys and title
- Why I getting only 1 post?