Pergunta

The articles/posts I've read about migrating Wordpress between local/staging/live servers talk about having to migrating the URLs each time - is this true?

Or can you simply switch Wordpress to use relative URLs?

Sorry if this is basic but hard-coded URLs make no sense so thought I'd check before following bad advice.

Foi útil?

Solução

Out of the box Wordpress uses absolute URLs. This requires you to make database updates when moving sites from development to production or when changing the base URL. I'm not sure why this choice was made but there are many options when moving sites.

  1. You can use a tool like WP Migrate DB Pro or another option that will work with serialized data to change the URL in the database after moving.
  2. Another option seems to be a plugin that changes that URLs to relative ones. It is up to date but I haven't used it so I can't endorse it. (https://wordpress.org/plugins/relative-url/)
Licenciado em: CC-BY-SA com atribuição
Não afiliado a wordpress.stackexchange
scroll top