Jump to content

Recommended Posts

Hi All,

 

I am building a tool which requires a website in an iframe (external) but with wording changes... I want the page to be indexed via Google but not as a duplicate page, So I was thinking of using str_replace(), I was thinking Synonyms for example "str_replace("party", "celebrate")".

 

This way I would have massive library of synonyms and they just rotate randomly. My problem is str_replace isn't working for the content in the iframe.

 

Does anyone know how I can do this? The page is external I am using iframes although if there is a better way I can do that. But I need to change wording within an external page but display on mine, I might be able to use javascript I don't know but I don't think javascript is ran for google...

Link to comment
https://forums.phpfreaks.com/topic/283673-str_replace-in-an-iframe/
Share on other sites

First off you should know that swapping out content like this is a form of content stuffing, is considered blackhat seo tactics, is against Google's ToS and you will be blacklisted for it.

 

If this somehow doesn't deter you from doing it, then here's your next problem: You can't do this with an iframe hosted on another site. This is considered cross site scripting (XSS) (read up on same domain origin policy). The only way to do what you are wanting to do is to use something like file_get_contents or the cURL library and retrieve the contents of the page, use str_replace to swap out the content, and then output it on your own page, not hosted externally in iframe.

Hi Josh,

 

What I am doing and how I am doing it is not black hat it sounds black hat but it isn't (should be) or not yet anyways.

 

I might need to look into the file_get_content form, and do a a str_replace. argh more work on this tool then expected 0.0

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.