Is there a possibility to remove the following two sentences from the SharePoint publishing site home page.
Welcome to Your Publishing Site These links will help you get started.
I'm currently adding new web parts to the page using csom while removing every webpart in the homepage using the below code. But it does not remove the above sentences.
using (clientContext)
{
Microsoft.SharePoint.Client.File page = clientContext.Web.GetFileByServerRelativeUrl(pageUrl);
clientContext.Load(page);
clientContext.ExecuteQuery();
if (page.CheckOutType == CheckOutType.None)
{
page.CheckOut();
}
var wpm = page.GetLimitedWebPartManager(PersonalizationScope.Shared);
clientContext.Load(wpm.WebParts);
clientContext.ExecuteQuery();
if (wpm.WebParts.Count != 0)
{
foreach (WebPartDefinition webpart in wpm.WebParts)
{
webpart.DeleteWebPart();
clientContext.ExecuteQuery();
}
}
var importedWebPart = wpm.ImportWebPart(webPartSchemaXml);
var webPart = wpm.AddWebPart(importedWebPart.WebPart, zoneid, zoneIndex.ToInt32());
page.CheckIn("", CheckinType.MajorCheckIn);
clientContext.ExecuteQuery();
}