The_content and Preg_replace in loaded Iframe [closed]

You can’t, it’s as simple as that.

Why Not?

First of all, because the DIV is not part of your content. It’s either generated by WordPress’ filters, or the browser itself. So, you can’t do preg_replace on something that doesn’t exist.

Secondly, there’s a matter of cross-domain policy. It’s not possible to manipulate the content of an iframe unless the two webpages belong to the same domain. Anything else, and you will get a security error. This is intentional, and to prevent acts such as spoofing.

For further information, take a look at this link.