---
title: Control Script And Style Loading For The Virtual Tours
description: "You can control the [WP VR](https://rextheme.com/wpvr/) assets, such as scripts and styles, to load only on the pages/posts you want. Simply follow the steps below ## **Control WP VR Script And Style Loading On Your Site** **1.** Go to the **Dashboard…"
url: "https://rextheme.com/docs/wp-vr-control-script-and-style-loading/"
updated: "2026-01-08"
category: WP VR / Advanced Settings for Virtual Tours
---

# Control Script And Style Loading For The Virtual Tours

You can control the [WP VR](https://rextheme.com/wpvr/) assets, such as scripts and styles, to load only on the pages/posts you want.

Simply follow the steps below

## **Control WP VR Script And Style Loading On Your Site**

**1.** Go to the **Dashboard > WP VR > Get Started** and on the top-right side, click on the **Settings** tab.

[![Control Script And Style Loading For The Virtual Tours 1](https://rextheme.com/wp-content/uploads/2019/02/image-17.png)](https://rextheme.com/wp-content/uploads/2019/02/image-17.png)

It will take you o the **General Setup Options** page where you will find all the exclusive settings of **[WP VR](https://rextheme.com/wpvr/)**.

[![Control Script And Style Loading For The Virtual Tours 2](https://rextheme.com/wp-content/uploads/2019/02/image-18.png)](https://rextheme.com/wp-content/uploads/2019/02/image-18.png)

**2.** Look for the options called **Enable Script Control**and enable it.

[![Control Script And Style Loading For The Virtual Tours 3](https://rextheme.com/wp-content/uploads/2019/02/image-19.png)](https://rextheme.com/wp-content/uploads/2019/02/image-19.png)

Turning it on will ensure that WP VR assets will no longer be loaded in any page on your site.

**3.**Now, go to the pages/posts where you want to load WP VR assets, seeming the pages where you embedded a virtual tour using WP VR, and copy their URLs.

![Copy URL of Tour Page](https://9a24j3cuqup2nbwj93fb42sz-wpengine.netdna-ssl.com/wp-content/uploads/2020/02/Copy-URL-of-Tour-Page.jpg)

**4.**Then go back to the **Settings** section of WPVR and look for the the option "**List of allowed pages to load WP VR scripts**".

[![Control Script And Style Loading For The Virtual Tours 4](https://rextheme.com/wp-content/uploads/2019/02/image-20.png)](https://rextheme.com/wp-content/uploads/2019/02/image-20.png)

One the field, paste the URLs that you just copied with commas between multiple URLs and no spaces.

For example, suppose you have two pages:

- https://mywebsite/test-1
- https://mywebsite/test-2

So here, you have to input them with just commas in between and no spaces.

Just like this:
https://mywebsite/test-1,https://mywebsite/test-2

**5.** Then click on the **Save** button below.

And that's it. Now, WPVR scripts and styles will be loaded only on the pages/posts that you have listed here.

**If you’re using any optimization plugin, you have to regenerate the optimized assets.**

Suppose you’re using the plugin Autoptimizer, here is how you can do it:

## **Exclude WPVR JS Files From Autoptimizer**

If you are using **Autoptimizer**, it will minify the JS files of WPVR and the tour will not show up.

So you have to exclude the plugin folders from the Autoptimizer.

Go to Autoptimizer and under **CSS, JS, and HTML** section, you’ll see the ‘**Exclude scripts from Autoptimize:**‘ field.

![Exclude WPVR JS From Autoptimizer](https://rextheme.com/wp-content/uploads/2020/02/Exclude-WPVR-JS-From-Autoptimizer.jpg)

If you’re using the free version of WPVR, add a comma (,) and include **wp-content/plugins/wpvr**.

If you’re using the pro version of WPVR, add a comma (,) and include **wp-content/plugins/wpvr, wp-content/plugins/wpvr-pro**.

Now scroll down and click on the **Save Changes and Empty Cache** button.

From now on, your virtual tours will show up on your site and the JS files of your website will still be optimized.

## **Exclude WPVR JS Files From SG Optimizer**

If you are using SG Optimizer, it may minify the JS files of WPVR and the tour may not show up.

So, you can exclude the pages with virtual tours from optimization to avoid this issue.

Go to **SuperCacher** then choose **Exclude URLs**.

![Exclude URLs from SG Optimizer](https://rextheme.com/wp-content/uploads/2020/02/Exclude-URLs-from-SG-Optimizer.png)

Copy the URLs of the posts or pages where you have published a virtual tour and paste it in this field.

You can list multiple URLs to exclude from being cached or optimized.

You can learn more about excluding URLs from SG Optimizer [from here](https://www.siteground.com/tutorials/wordpress/sg-optimizer/supercacher/#Exclude_URLs).
