0

I'm developing a site on my local machine and am now adding the content that I want to go live with.

But I noticed that when I add a link in the new Gutenberg editor, the link is absolute, e.g. it's something like http://localhost:8200/my-page-here, which seems bizarre.

I also have ACF installed and the page links I define with that are perfect. I changed the permalink for one page, and all the places I had it in ACF updated automatically, but I had to manually change the links in content pages. And when I go live, I'm going to have to change them all again.

That seems incredibly weird to me. To the point that I think I'm missing something simple. So am I?

2
  • 1
    This is exactly how the existing 'classic' editor works, so I'm not sure why this is so surprising. Imagine if you add the link and then change the page to have a parent, that would break any relative links. Using absolute links is the safest way to link in HTML. Sep 12 '18 at 0:56
  • Have you raised an issue on the Gutenberg github? As others have said, this is the same behaviour WP has always had, ACF is a 3rd party plugin that does its own thing
    – Tom J Nowell
    Sep 12 '18 at 1:11
1

It doesn't have anything to do with Gutenberg. It's just the way WordPress stores links in the main content. Anytime you add a link in the WP editor, it automatically puts in the absolute path. ACF and other forms of custom postmeta instead store the post ID, so whenever its slug/permalink changes they are automatically updated.

When you push content from your local site, just use a database migration plugin, which will handle all the URL changes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.