Software

How to Embed a Virtual Tour on a Website: Responsive Guide

September 06, 2026 • By SVT Team
How to Embed a Virtual Tour on a Website: Responsive Guide

Embedding a virtual tour on a website lets visitors explore a space without leaving the page where they are evaluating a property, hotel, venue, showroom, or service. The usual method is an iframe: a small HTML element that loads the published tour inside a defined area of your page.

A working embed requires more than pasting a URL. The container must adapt to different screens, the tour needs enough height to remain usable, mobile controls must be easy to reach, and loading should not slow down the rest of the page. This guide explains the complete process and the practical decisions behind a reliable result.

What You Need Before Embedding a Virtual Tour

Start with a published tour that opens through a secure HTTPS URL. Test that URL in a private browser window to confirm that visitors can access it without signing in. If the tour is restricted, unpublished, or available only inside an editor, the same limitation will appear in the embedded version.

The tour provider must also permit iframe embedding. Some services block it through browser security headers, while others provide a dedicated share or embed URL. Use the published embed code supplied by the platform whenever possible because it may remove editor controls or apply viewer-specific settings.

How to Embed a Virtual Tour with an Iframe

Copy the tour's public URL or the iframe code from its sharing settings. Then paste the iframe into the HTML area of the page where the tour should appear. In a content management system, this area may be called Custom HTML, Code, Embed, or HTML Source.

A basic embed follows this pattern:

Iframe example: <iframe src="https://example.com/your-tour" width="100%" height="600" allowfullscreen loading="lazy"></iframe>

Replace the example address with the real published tour URL. The src attribute identifies the tour, width controls horizontal space, height sets the visible vertical area, allowfullscreen permits immersive viewing, and loading="lazy" delays loading until the embed approaches the viewport.

Make the Virtual Tour Responsive

A fixed pixel width can overflow on phones or leave unnecessary space on larger screens. Setting the iframe width to 100% makes it follow the width of its parent container. The surrounding page layout then determines the maximum width.

Height needs separate attention because a percentage height works only when the parent has a defined height. The most dependable approach is to place the iframe inside a responsive container that uses an aspect ratio, then make the iframe fill that container.

Responsive container example: <div style="position:relative;aspect-ratio:16/9;width:100%;"><iframe src="https://example.com/your-tour" style="position:absolute;inset:0;width:100%;height:100%;border:0;" allowfullscreen loading="lazy"></iframe></div>

A 16:9 ratio works well for many page layouts, but it is not mandatory. A taller ratio can improve exploration on narrow screens. If your website theme already includes a responsive embed component, use it instead of adding inline styles, provided it gives the iframe both responsive width and a stable height.

Choose Width and Height for the Page Context

  • Full content width: Use 100% width inside the main page column so the tour aligns with surrounding content.
  • Desktop height: Aim for enough vertical space to see the scene and controls without constant scrolling; approximately 500 to 700 pixels is a practical starting range.
  • Mobile height: Test a taller viewport or a minimum height when a 16:9 frame makes controls and hotspots feel crowded.
  • Maximum width: Keep the tour within the site's normal content grid unless an intentional full-width section suits the page.
  • Fullscreen: Preserve a fullscreen option for visitors who want the most immersive view.

Optimize the Embed for Mobile Visitors

Open the actual page on a phone rather than relying only on a resized desktop browser. Confirm that visitors can drag the panorama without moving the page unexpectedly, select hotspots without accidental taps, open menus, close information panels, and enter or leave fullscreen.

Leave enough space around the embed so nearby buttons and navigation do not compete with tour controls. Avoid placing essential instructions only below a tall frame, where visitors may not discover them. A short sentence above the embed can explain that they can drag to look around, tap hotspots, and use fullscreen.

Account for Browser and Orientation Changes

Mobile browser toolbars change the available viewport as a person scrolls, and rotating a device can alter the frame abruptly. Test portrait and landscape modes, especially if the tour uses overlays, floor plans, or bottom navigation. The embedded viewer should recalculate its dimensions without leaving blank areas or cropping controls.

Improve Page Performance

A virtual tour may load panoramas, scripts, interface assets, maps, video, and analytics. Loading all of that immediately can delay the page's main content. Add loading="lazy" when the tour is below the first screen, and avoid placing several active tour embeds on one page.

For pages with multiple tours, use a preview image and a clear launch button for each one, then load the selected tour on demand. This reduces initial network work and gives visitors control. Compress the source panoramas appropriately inside the tour platform as well; iframe settings cannot compensate for oversized assets.

  • Keep the page focused: Embed the most relevant tour instead of several similar viewers.
  • Reserve space: Give the container a fixed aspect ratio or minimum height to prevent layout shifts while loading.
  • Limit competing media: Avoid autoplay video, large sliders, and other heavy elements beside the tour.
  • Test real connections: Review the page on a typical mobile network, not only fast office Wi-Fi.
  • Check third-party scripts: Consent tools and security policies must allow the tour domain to load.

Design the Page Around the Tour

Place the embed where it supports the visitor's decision. On a property page, it may follow the summary and key facts. On a hotel page, it can sit near a room description or booking action. On a portfolio page, a preview and short project explanation may work better than opening immediately with a large interactive frame.

Add a descriptive heading, one sentence of context, and a meaningful action after the tour. The next step might be requesting information, checking availability, booking a visit, or viewing another relevant page. Keep the action connected to what the visitor has just explored.

Provide an Alternative to the Embedded Viewer

Include a normal link that opens the tour in a new page or tab. This helps when an embedded viewer is blocked, when a visitor prefers a larger view, or when an assistive technology cannot use every interactive control. Use descriptive link text rather than a vague instruction such as “click here.”

Embedding in WordPress and Other Website Builders

In WordPress, add a Custom HTML block and paste the provider's iframe code. Page builders usually offer an HTML, Code, or Embed widget that serves the same purpose. Preview the public page after saving because visual editors sometimes display a placeholder instead of the live iframe.

Hosted builders may sanitize custom code or limit iframe domains. If the code disappears after saving, consult the platform's embed rules or use its official URL embed component. Do not convert the tour into a static screenshot as a workaround; a screenshot can be a preview, but it does not provide the interactive experience.

Security, Privacy, and Accessibility Checks

Use HTTPS for both the website and the tour to avoid mixed-content blocking. If your site applies a Content Security Policy, add the exact tour host to the permitted frame sources. Avoid overly broad permissions, and include only iframe features the tour genuinely needs.

Give the iframe a concise title attribute in the final production code, such as “Virtual tour of the property,” so screen reader users can identify it. Check keyboard navigation, visible focus, color contrast, media captions, and whether essential information also exists as normal page text. A tour should enrich the page rather than become the only way to access critical details.

Common Virtual Tour Embedding Problems

  • The iframe is blank: Confirm the URL is public, uses HTTPS, and allows embedding on another domain.
  • The tour is cropped: Remove conflicting fixed dimensions and verify that both the container and iframe have a usable height.
  • The frame overflows on mobile: Use 100% width and inspect parent containers for fixed widths or excess padding.
  • Fullscreen does not work: Include the fullscreen permission and check whether a parent iframe or site policy blocks it.
  • The page loads slowly: Lazy-load below-the-fold embeds, reduce competing media, and optimize the tour's panorama assets.
  • Clicks do not respond: Check whether a cookie banner, overlay, sticky element, or incorrect z-index is covering the iframe.

Test the Embedded Tour Before Publishing

  1. Open the public page: Test outside the website editor and in a private browser window.
  2. Check responsive sizes: Review wide desktop, laptop, tablet, and narrow phone layouts.
  3. Use every control: Drag the scene, open hotspots and menus, change scenes, and test fullscreen.
  4. Review loading: Confirm that reserved space prevents layout shifts and lazy loading activates at the right time.
  5. Verify links and actions: Test the fallback link and the page's next-step CTA.
  6. Repeat after updates: Recheck the embed when the tour URL, website theme, consent settings, or security policy changes.

If you are still preparing the experience itself, the guide on how to build interactive virtual tours covers scenes, hotspots, navigation, media, and testing. For control over where tours and assets live, compare self-hosted and cloud virtual tour software.

Frequently Asked Questions

Can I embed a virtual tour on any website?

You can embed a tour when the website accepts iframe code and the tour host permits other domains to frame its viewer. Some hosted builders restrict custom HTML, so you may need their official embed component or a public link instead.

What size should an embedded virtual tour be?

Use 100% of the available content width and start with a 16:9 container or a desktop height around 500 to 700 pixels. Test the actual controls on phones and increase the mobile height when the interface feels compressed.

Does an iframe make a website slower?

An iframe adds the network and processing cost of the content it loads. Lazy loading, reserving its space, limiting the number of embeds, and optimizing tour assets reduce its effect on initial page performance.

Why does my virtual tour work directly but not inside the website?

The tour host may block iframe use, the page may mix HTTPS and HTTP content, or a Content Security Policy may reject the tour domain. Browser developer tools can identify the exact blocked-frame or security message.

Should the virtual tour open in fullscreen?

Fullscreen is valuable for detailed exploration, especially on phones, but it should remain optional. Visitors should also be able to use the tour within the page and exit fullscreen easily.

Publish an Embed That Works on Every Screen

A strong virtual tour embed combines a valid public URL with a responsive container, practical dimensions, mobile testing, controlled loading, and clear page context. Treat the iframe as part of the complete user journey: introduce it, make it comfortable to explore, and provide an accessible next step.

Simple Virtual Tour helps you create and publish interactive tours that can become part of your own website experience. Explore the live demo to see a tour in action, or review the available options for building and hosting virtual tours.

Ready to build your own Virtual Tours?

Join thousands of photographers and agencies using Simple Virtual Tour. No monthly subscription fees. You own the software.