Prevent Google from indexing iframes while allowing indexing iframe content embedded in other pages
Let's assume there's an HTML page hosted on http://programmer-domain.example/iframe.html
, containing text "SDFHIASDFASDFKSDAF".
Let's assume there's also another page, http://customer-domain.example/index.html
, that includes this first page via an iframe tag.
As it's known, Google indexing engine indexes the iframes in a way if you google for "SDFHIASDFASDFKSDAF", both pages will be shown in results.
How can this be achieved that only the page in customer-domain.example
is indexed, but not the programmer-domain.example
one? I guess using noindex in HTML tags of iframe.html
, or Disallow-ing in robots.txt
of programmer-domain.example
will result in no pages being indexed.
You could try to set a canonical tag to your parent document. Add the following to the head of your iframe:
<link rel="canonical" href="https://your-parent-document" />
This is a signal to search engines that your parent doc is the preferred resource.
These questions might be of interest for you:
- Can canonical links and noindex be used with iframes
- Google Ignoring Canonical - Asking for Advice on Alternative Option
Comments
Post a Comment