What is the best way to optimize iframe content on a web page for search engines
As far as I can tell from multiple google searches, searching for the text contained in the iframe only returns the iframe page, not the wrapper page. This way the content of the iframe is not indexed on the wrapper page.
You should try to find a workaround for the iframe if possible. If you just want "scrollable" content, you can use a div with CSS overflow:scroll
. Or just read the external content from the server side and include it in the line with the page.
a source to share
- optimize text in iframe-container-page and de-optimize text in iframe-content-page. use the title property of the iframe and insert alternate content between the opening and closing iframe tags.
-
add javascript to iframe-content-page to check if it's loaded offline, redirect to iframe-container-page if not:
if (self.location == top.location) top.location.replace (' http://contain.er/page-url/here ');
-
Optional (but I wouldn't recommend it) you could add the iframe-content page to your robots.txt file and declare it not indexable:
User agent: * Disallow: /iframe-content-page.html
a source to share