Find and replace external URL references with internal link

The requirements are the following:

  • We have thousand of rich text components which has URL references to external pages
  • These references needs to be replaced by an internal Sitecore item reference based on a field of the pages

I ended up with the following script:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s