diff --git a/lms/templates/main.html b/lms/templates/main.html
index 42d5a71228ba7038ee76986eac23a6a21ffbc555..02e3c9fa469be9e758aad8e5ad4c0af54e9a5930 100644
--- a/lms/templates/main.html
+++ b/lms/templates/main.html
@@ -3,6 +3,15 @@
 <html>
 <head>
   <%block name="title"><title>edX</title></%block>
+  <script type="text/javascript">
+  /* immediately break out of an iframe if coming
+     from the marketing website */
+  (function(window) {
+    if (window.location !== window.top.location) {
+      window.top.location = window.location;
+    }
+  })(this);
+  </script>
 
   <link rel="icon" type="image/x-icon" href="${static.url('images/favicon.ico')}" />