Support » Fixing WordPress » Embedding an external site into wordpress

  • bytesizekieran


    How’s it going there!
    I have something here that I hope someone here would know how to steer me onto the right track!
    I’m looking to embed an external site onto this page here to act as the specs page for our site which will be hosted externally on squarespace as in theory that is more user friendly to update for the team here.
    I’ve tried myself using online guides to do it myself using iFrame code but I get keep getting this error
    Screen 1
    which just redirects me to the contact us page

    Anyone have any tips on where I can go from here?

    • This topic was modified 1 year ago by  Jan Dembowski. Reason: Moved to Fixing WordPress as this is not a Developing with WordPress topic

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Harry Jackson


    Hello bytesizekieran!

    Reviewing your page, it seems you are using as the source, and I believe that may be part of the reason your iframe is not working. I have created an iframe using the following code, and an HTML site as the source, and it is working within the WordPress editor:

    <iframe src="//" width="100%" height="800px" frameborder="0"></iframe>

    I could not get it working with, or .com for that matter.

    I also noticed within your source code, that the iframe tag itself has curly quotes, rather than the straight up and down ones, so you may want to switch to the text editor for adding that code, and not the visual tab, to keep that from occurring.

    I hope this helps you accomplish what you are looking for.


    Moderator bcworkz


    The server sends a x-frame-options: SAMEORIGIN header, which means browsers will not display content from this server embedded in an iframe unless the page with the iframe is from the same origin as content. In other words, you cannot embed content from this site inside of iframes, the site does not allow it.

    The server does not send such a header, so iframe content is displayed. However, if the server did send a SAMEORIGIN value, and Harry tested his iframe from the same server, the SAMEORIGIN value would allow it, but if we did the same iframe test from our servers, the request would then still fail.

    The curly quotes Harry mentions often creep in when copying code from sites like this one where simple straight quotes get styled into curly quotes on output. It’s just something you need to watch out for when copying code from the ‘net. In these forums, using backticks or the code button prevents the curly quote conversion. Always do this when posting code in these forums 🙂



    Cheers for the help, this site is indeed on Premium Plan and I’ve found where they had the previous embeded site working

    Using the below code

    		Template Name: Specs
    <div class="section-row specs"> 
        <div class="max-container">
            <div class="breadcrumb"><a href="/" title="back home">Home</a> / Specs </div>
         <div id="frame-holder">
    	 	var frame_url = '',
    			elemen = document.getElementById('frame-holder');
    			var url_hash = window.location.hash.substr(1),	
    			url_hash = url_hash.replace("+", "/"); 
    			frame_url = frame_url+url_hash;
    		elemen.innerHTML = '<iframe id="rteframe" src="'+frame_url+'" width="100%"></iframe>';
    </div><!-- END .section-row; -->
    <?php get_footer(); ?>

    Got access to the FTP and updated with a new google site link and now the page is appearing blank.

    • This reply was modified 1 year ago by  bcworkz. Reason: code fixed, otherwise syntax errors occur with testing
    Moderator bcworkz


    What did I last say about posting code in these forums? 😛
    Without backticks, your template code requires major editing before anyone can test it for you. I fixed it up for you so it’s testable as-is.

    Your template works fine on my site, the embed appears correctly. Check your error log, there may be a conflict with your theme’s header or footer templates.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Embedding an external site into wordpress’ is closed to new replies.