ABT Relative Urls Wordpress Plugin - Rating, Reviews, Demo & Download
Plugin Description
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:
Screenshots
-
Normal text entry – notice from side-by-side with HTML source that absolute links are present
-
Resulting output after saving (and scrubbing) – notice that in the Firebug HTML output, links are relative except where shortcode used.