Relative Urls (ABT)

By default, WP inserts absolute urls (including protocol and domain) into post content. Replace all self-referencing links with relative paths “/” instead. Works when inserting images into posts, and on the actual save_post action.

Author:atlanticbt, zaus, willhaley (profile at wordpress.org)
WordPress version required:2.8
WordPress version tested:3.5
Plugin version:0.4
Added to WordPress repository:13-02-2012
Last updated:18-01-2013
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:80
Rated by:2
Plugin URI:http://atlanticbt.com/blog/wordpress-relative...
Total downloads:2 208
Active installs:100+
plugin download
Click to start download

By default, WP inserts absolute urls into post content; this includes the protocol and domain, which is based on the home Admin setting. This plugin replace all self-referencing (domain) links with relative paths "/" instead. Works when inserting images into posts, and on the actual save_post action it scrubs the content, excerpt, and post_meta fields.

Especially helpful when developing on a DEV site with the intention of transfering to a LIVE domain. Please note that you should use this plugin before you start adding content, or you'll have to resave everything later.

Includes code based on Relative Image URLs plugin, which strips domain when inserting images from the Media Library. A similar idea to the following, but acts as a preventative measure (while you're working), works automatically, and handles meta fields: