{"id":381,"date":"2018-12-15T14:27:45","date_gmt":"2018-12-15T13:27:45","guid":{"rendered":"https:\/\/ekiwi.de\/?p=381"},"modified":"2018-12-15T14:27:45","modified_gmt":"2018-12-15T13:27:45","slug":"wordpress-absolute-pfade-vermeiden","status":"publish","type":"post","link":"https:\/\/ekiwi.de\/index.php\/381\/wordpress-absolute-pfade-vermeiden\/","title":{"rendered":"WordPress: Absolute Pfade vermeiden"},"content":{"rendered":"<p>Ein kleiner Kurztipp f\u00fcr WordPress. Standardm\u00e4\u00dfig werden beim Upload von Bildern absolute Pfade in Postings und Seiten eingebaut.<\/p>\n<p><!--more--><\/p>\n<p>Zieht man die Seite um, zeigen alle Bilder und Links noch auf alte absolute URLs. Hier ein Beispiel:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/wp-content\/uploads\/2018\/12\/full_path_wordpress.png\" alt=\"\" width=\"615\" height=\"247\" class=\"aligncenter size-full wp-image-382\" srcset=\"\/wp-content\/uploads\/2018\/12\/full_path_wordpress.png 615w, \/wp-content\/uploads\/2018\/12\/full_path_wordpress-300x120.png 300w\" sizes=\"auto, (max-width: 615px) 100vw, 615px\" \/><\/p>\n<p>Die Bilder sind mit der vollst\u00e4ndigen URL und Domain verlinkt. Beim Umzug auf eine andere Domain m\u00fcssen alle diese Links aktualisiert werden. Zwar gibt es <a href=\"https:\/\/de.wordpress.org\/plugins\/velvet-blues-update-urls\/\" rel=\"noopener\" target=\"_blank\">hierf\u00fcr Plugins<\/a>, aber idealerweise legt WordPress die Links gleich so an, dass es keine Probleme gibt.<\/p>\n<p>Relative URLs kann man in der <code>wp-config.php <\/code>Datei festlegen:<\/p>\n<pre>define( 'WP_CONTENT_URL', '\/wp-content');<\/pre>\n<p>Anschlie\u00dfend werden Bilder und Resourcen ohne Domain verlinkt:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/wp-content\/uploads\/2018\/12\/full_path_wordpress_1.png\" alt=\"\" width=\"452\" height=\"171\" class=\"aligncenter size-full wp-image-383\" srcset=\"\/wp-content\/uploads\/2018\/12\/full_path_wordpress_1.png 452w, \/wp-content\/uploads\/2018\/12\/full_path_wordpress_1-300x113.png 300w\" sizes=\"auto, (max-width: 452px) 100vw, 452px\" \/><\/p>","protected":false},"excerpt":{"rendered":"<p>Ein kleiner Kurztipp f\u00fcr WordPress. Standardm\u00e4\u00dfig werden beim Upload von Bildern absolute Pfade in Postings und Seiten eingebaut.<\/p>\n","protected":false},"author":1,"featured_media":278,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[51],"tags":[52],"class_list":["post-381","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/posts\/381","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/comments?post=381"}],"version-history":[{"count":0,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/posts\/381\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/media\/278"}],"wp:attachment":[{"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/media?parent=381"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/categories?post=381"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/tags?post=381"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}