Adding or updating posts failed when changing Wordpress Site Address different than Wordpress address

Hello everyone!

I’ve been working with Frontity now more than two months, and I’m still quite new. I have finally managed to deploy my website.
However, I have some issues here, and I hope you can help me with this.

I don’t know how you guys are solving the backend URL issue, but I tried to change under the WordPress general settings that WordPress address (URL) is different than Site address as I would like to redirect any traffic made to my WordPress address to Vercel domain. For instance, if the user is going to my WordPress address, which is in my case content.reinaldudras.ee and visits it, they will be forwarded to reinaldudras.ee as content.reinaldudras.ee is the domain where Frontity is fetching the WP posts and therefore only content.reinaldudras.ee/wp-admin should be accessible for content management.

I’ve found out that having a WordPress address as the backend address (content.reinaldudras.ee) for admin access only and site address (reinaldudras.ee in my case) as a front-end address could solve that issue. Visitors would never see WordPress address in the front end (it will be redirected to reinaldudras.ee), but when doing that, then adding posts or updating them fails with the following error: “Updating failed. You are probably offline.”

So every time I want to add or update posts, pages, etc. I would have to change the Site address back to content.reinaldudras.ee. Any ideas on how I can add posts, pages, etc., and update them without having to do this every time?

Thank you for any advice!

Hi, @reinaldudras hope you are enjoying Frontity :grinning_face_with_smiling_eyes: . Here is the explanation of your error and also the solutions.

The Issue is the Editor’s Functionality

The editor you are using is Gutenberg. Whenever you add or update any post on Gutenberg editor, it sends the information to the backend using Ajax, and because you have change the site or home URL, it could not find the destination ajax URL to update the content. That’s why it says, you are offline.

I hope you understand the error.

Solution :sunglasses:

The simplest solution for this issue is you can install Classic Editor, because this editor does not use ajax to update data, it refreshes the whole page to update any data, so it does not matter if you change your site url.

Tips and Recommendations :bulb:

There is a better way to host your frontity on vercel.

  1. Host your WordPress on yourdomain.com
  2. Install Frontity Embed plugin
  3. Host your frontity project to vercel.
  4. Create a subdomain like frontity.yourdomain.com
  5. Update the nameserver or DNS of the subdomain to vercel’s nameserver or DNS
  6. Now your project is already up and running on frontity.yourdomain.com
  7. Now from WordPress admin, Inside the settings menu, you will see a sub-menu called frontity embed, click on that, and just past this url frontity.yourdomain.com.
  8. Hurrrraaa, now yourdomain.com will automatically open frontity.yourdomain.com inside it, whereas at the same time you will be able to access your WordPress admin panel using this url - yourdomain.com/wp-admin.

I hope this will help you. All the best :smiling_face_with_three_hearts:

1 Like

Thank you so much! It was very helpful :smiling_face_with_three_hearts:

1 Like