{"id":13661037,"date":"2020-11-13T22:15:23","date_gmt":"2020-11-13T22:15:23","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/absolute-or-relative-paths\/"},"modified":"2020-11-13T22:15:23","modified_gmt":"2020-11-13T22:15:23","slug":"absolute-or-relative-paths","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/absolute-or-relative-paths\/","title":{"rendered":"Absolute or Relative Paths"},"content":{"rendered":"<p>When I add an image WP creates an absolute link like: <code>https:\/\/www.mysite.com\/wp-content\/blah\/blah\/mypicture.jpg<\/code>. If a user does a search for <code>mysite<\/code> every page with an image will be found. A similar problem occurs with links to another page. Since my site name (<code>binnenstadduurzaam<\/code>) comprises the (Dutch) words for &#8220;city-center&#8221; and &#8220;sustainable&#8221;, such a search is quite likely. <\/p>\n<p>My workaround is to manually edit the links to be relative thus: <code>..\/wp-content\/blah\/blah\/mypicture.jpg<\/code>. This is time-consuming and error-prone, so I am looking for a better solution.<\/p>\n<p>I found several plugins which offer conversion from absolute to relative paths, but all but one are several years old and &#8220;untested for your version&#8221;. The plugin &#8220;Make Paths Relative&#8221; seems to be up-to-date but does not work on my test site (preview pictures in the Media Library are not displayed). The test site is (something like) <code>https:\/\/private.mysite.com\/wp-test\/<\/code>; possibly the use of a different subdomain causes problems. Obviously I daren&#8217;t test it on my live site <code>https:\/\/www.mysite.com<\/code>.<\/p>\n<p>Is there an up-to-date plugin which does what I want? or does the lack of plugins indicate that there is a WP option which I haven&#8217;t found? Or is there a better workaround? The problem exists with themes 2020 and Neve.<\/p>\n","protected":false},"template":"","class_list":["post-13661037","topic","type-topic","status-publish","hentry","topic-tag-absolute","topic-tag-links"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/13661037","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/13661037\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=13661037"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}