Search code examples
phphtmlwordpressiframex-frame-options

Is it possible to get HTML code of a site using denied x-fram-option header?


I need to show Envato Elements content into my site. I have tested the iframe tag, but site has refused the connection. I have tested the object tag, but no success. I have tested the PHP's file_get_contents function, but nothing again. However, there are some sites showing the Envato Elements content.

I have done a little research and found out about X-Frame-Options header. Envato Elements is using it to deny the content. I know everything about that, but there are some WordPress plugins exist that can get the source of popular sites like Envato and any WordPress sites. Envato is not on WordPress, but that plugin can still show its content.

So my question is how that plugin is doing it? Is there any way I can do it too?

plugin link :‌ https://codecanyon.net/item/wp-content-crawler-get-content-from-almost-any-site-automatically/15983018


Solution

  • I actually wrote a plugin that's designed to import content into your WordPress site. Note, it's only intended for use with content you have a license to use. It actually works* with Envato, but the site quickly redirects/reloads with this message:

    enter image description here

    This indicates the assets are served from a whitelist, and of course my nobody little server isn't on that whitelist.

    So the only way to embed this into your site would be to Contact them or directly inquire their Partnerships & Business development team: business@envato.com and get approval/access to do so. Honestly, given Envato's business model - I wouldn't go in with high hopes outside of having an outstanding and well-documented partnership model in mind.

    Sites that block/deny/redirect non-whitelisted requests to their site generally have good reasons to do so, and so they only ethical way around it is to contact the site owner and request a whitelist with some sort of partnership proposal.