I have SharePoint Site on SharePoint online with Pages library having 5 pages with content. Need to modify the URL in the pages programmatically using Client Object Model

suppose I have Newname.aspx page and this page is having some links which I need to modify pragmatically. Newname.aspx is having 15 broken links, every time I have to open this page in edit mode and manually update all broken links.

Is there any way to modify these broken links programmatically.

  • Is there any way to update the Broken links in the page
    – user53451
    Commented May 2, 2016 at 10:08

1 Answer 1


It depends :)

if these columns are just fields that you added on the page content type or on the page library itself and they are added on the page layout, then it is as easy as update the columns with the link you like.

I believe this is not the case, and the links are stored as a part of the page content field. This will require to search and replace the column using java script or even console app (if you are using 2010 or 2013 on prem)

here is an example using the console app: http://habaneroconsulting.com/insights/programmatically-change-content-on-a-wiki-page-in-sharepoint-2010#.VytcZYSDFBc

example using javascript (look for the Update a file in a document library section): https://msdn.microsoft.com/en-us/library/office/jj163201.aspx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.