Not sure if the title is clear, but what I want to achieve is deploy a Custom Web Part using SharePoint Hosted Apps to SharePoint Online. But I don't want the App to appear in "Site Contents".

I followed tutorials online and was successful in uploading a Custom Web Part I can use.

What I noticed when doing this though, is that when I go to "Site Contents", I see my App there. I don't want it showing there since I don't have any use for it there. Is there a way I can remove it from "Site Contents" or is it recommended? I deleted the default.aspx, but when user tries to access, it shows him 404 not found.

Thank you

1 Answer 1


If you dont plan to use the store to deploy your app you could simply go with a modified built-in webpart that you can export and import in the desired webpartcatalogs. These wont show up in the SiteContents.

We are mostly using the Microsoft.SharePoint.WebPartPages.XmlWebPart since it has a property where we can save persistent settings for our webpart.

You should not add script tags to the html referenced in the webpart since it destroys mds. We are using UserCustomActions to add the JavaScript to the pages. The JavaScript searches the page for instances of out webpart and does the magic. Here's a example:

<?xml version="1.0" encoding="utf-8"?>
<WebPart xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/WebPart/v2">
  <Title>Your WebPart Title</Title>
  <Description>Your WebPart Description</Description>
  <Height />
  <Width />
  <DetailLink />
  <HelpLink />
  <PartImageSmall />
  <MissingAssembly>Cannot import this Web Part.</MissingAssembly>
  <IsIncludedFilter />
  <Assembly>Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
  <XMLLink xmlns="http://schemas.microsoft.com/WebPart/v2/Xml" />
  <XML xmlns="http://schemas.microsoft.com/WebPart/v2/Xml"><![CDATA[<div class="SOME_CLASS_SO_YOU_CAN_FIND_THIS_VIA_JAVASCRIPT"></div>]]></XML>
  <XSLLink xmlns="http://schemas.microsoft.com/WebPart/v2/Xml" />
  <XSL xmlns="http://schemas.microsoft.com/WebPart/v2/Xml" />
  <PartStorage xmlns="http://schemas.microsoft.com/WebPart/v2/Xml">{"exampleSetting" : "here you can save your settings"}</PartStorage>

Simply save this with a .dwp extenstion and add it to your webpartcatalog. As i described the intelligence should be placed in a usercustomaction.

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.