How can I disable the mobile view option in Wix without it automatically adapting?

How can I disable the mobile view option in Wix without it automatically adapting? I need that when someone enters my site from a mobile device, it shows an error and says that it can only be accessed from a PC.

You are on the right track!!!

  1. First deactivate the s..tt.y mobile friendliness (which is not one of best solution).

First step done!!!

The rest will be managed by code…
Then you will need some code like…

EXAMPLE:

import wixLocation from 'wix-location';

$w.onReady(function () {
  // Use Wix's built-in device type detection
  if (wixWindow.formFactor === "Mobile") {
    // Redirect mobile visitors to a "Desktop Only" page
    wixLocation.to("/desktop-only"); 
  }
});
Value Meaning Typical Use Case
"Desktop" Visitor is using a desktop or laptop browser. Load full-featured site, desktop layouts.
"Tablet" Visitor is on a tablet-sized device. Show simplified layout or block access like mobile.
"Mobile" Visitor is on a smartphone or small-screen mobile device.

Now you have the basic code → expand it’s functionality, by upgrading the code for your won needs!

1 Like