Frontity Docs
  • ยป Welcome to Frontity
  • ๐Ÿš€Getting started
    • Quick start guide
  • ๐Ÿ“ƒAbout Frontity
    • Frontity features
    • Browser support
    • Get involved
  • ๐Ÿ“šCore Concepts
    • 1. Project
    • 2. Settings
    • 3. Packages
    • 4. Roots
    • 5. State
    • 6. Actions
    • 7. Libraries
    • 8. Namespaces
    • 9. Styles
  • ๐Ÿ—๏ธArchitecture
    • Decoupled Mode
    • Embedded Mode
  • ๐ŸŒŽDeployment
    • Deploy Frontity using Vercel
    • Deploy Frontity on Layer0
    • Deploy Frontity on Heroku
  • ๐ŸŒ—Isomorphic React
  • โšก๏ธ Perfomance
    • Caching
    • Link prefetching
    • Lazy Loading
    • Code Splitting
  • ๐Ÿ”ŽSEO
  • ๐Ÿ“–Guides
    • Setting the URL of the WordPress data source
    • Using Environment Variables in a Frontity project
    • WordPress requirements for Frontity
    • URLs in a Migration from WordPress to Frontity Decoupled Mode
    • Frontity Query Options
    • Redirections with Frontity
    • Understanding a Frontity project
    • Add a new Frontity package or theme to your project
    • How to share your Frontity project
    • Understanding Mars Theme
    • Working with processors
    • How to process page-builder content in Frontity
    • Keep Frontity Updated
    • Troubleshooting
    • JavaScript
    • React
  • ๐Ÿ‘Contributing
    • How to contribute?
    • Contributing Guide
Powered by GitBook
On this page
  • The issue with URLs in this scenario
  • Updating the URLs in WordPress
  • Using a plugin
  • Updating manually

Was this helpful?

  1. Guides

URLs in a Migration from WordPress to Frontity Decoupled Mode

PreviousWordPress requirements for FrontityNextFrontity Query Options

Last updated 2 years ago

Was this helpful?

If you are migrating an existing WordPress site to Frontity and you are using , you will need to change the URL of your WordPress site. You need to do this as the primary domain (i.e. the one that site visitors use) will point to the Frontity site, and the domain that points to the WordPress installation will need to be changed to the secondary domain (or subdomain).

The issue with URLs in this scenario

Let's take as an example a WordPress site under the domain www.domain.com. Let's suppose that we want to migrate this to Frontity in Decoupled Mode. We will need to make the following changes:

  • www.domain.com will point to the Frontity server

  • wp.domain.com will point to the WordPress server

In this scenario internal links that exist in the content when the WordPress URL is changed to wp.domain.com will still point to www.domain.com. However, if any content is added after the change then internal links will point to wp.domain.com. This creates a situation where internal links in the content are inconsistent, with "old" links pointing to www.domain.com and "new" links pointing to wp.domain.com.

Updating the URLs in WordPress

Also, for the reasons stated above, any URLs in the content stored in the database also need to be updated to reflect the new domain (e.g. wp.domain.com). This can be done in 2 ways:

  • With a WordPress plugin

  • Updating the URLs manually

Using a plugin

To change the URLs in the content stored in the database you can use a plugin such as one of the following:

Updating manually

Before running the commands below ensure that you have a backup of your database!

UPDATE wp_options SET option_value = replace(option_value, 'https://www.domain.com', 'https://wp.domain.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'https://www.domain.com', 'https://wp.domain.com');
UPDATE wp_posts SET post_content = replace(post_content, 'https://www.domain.com', 'https://wp.domain.com');

Note that WordPress always uses absolute links internally, rather than relative links. WordPress uses the to determine where the internal links should point to.

In addition, the uses the (which will now be wp.domain.com) to convert links to a <Link /> component. So if the internal links are left pointing to www.domain.com the link processor won't work on those links because it will only convert links pointing to wp.domain.com, i.e. the URL of the WordPress data source.

You will therefore need to change in the "Settings" page of the WordPress admin so they point to new URL (e.g. wp.domain.com).

.

You can also update the links manually by running the following SQL commands using either phpMyAdmin or an application such as or .

๐Ÿ“–
internal URL Settings
link processor
domain configured as the WordPress data source
the WordPress Address and the Site Address
Velvet Blues Update URLs
Go Live Update URLs
Better Search Replace
Sequel Pro
Sequel Ace
Decoupled Mode