# Hide Custom Objects and Custom Permissions in Your Subscribers’ Orgs

Occasionally, you want to include custom permissions or custom objects in a package but not show them to your subscribers. For example, if you're piloting a feature for a few select orgs, and want to hide custom permissions and custom objects related to the pilot feature.

:::note
Check with your company’s legal team before releasing hidden functionality.
:::

To hide custom objects when creating your package, set the value of their Visibility field to `Protected`. After you've set the visibility to Protected, you can later update it to Unprotected. To change the visibility of an object, use the [CustomObject](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/customobject.htm) Metadata API and update the `visibility` field.

To hide custom permissions when creating your package, from Setup, enter `Custom Permissions` in the Quick Find box. Select **Custom Permissions** | ***Your Custom Permission*** | **Edit**. Enable **Protected Component**, and then click **Save**. After your package is installed, use the `System.FeatureManagement.changeProtection()` Apex method to hide and unhide custom objects and permissions.

:::note
After you’ve released unprotected objects to subscribers, you can’t change the visibility to `Protected`.
:::

**To hide custom permissions in released packages:**

- `System.FeatureManagement.changeProtection('YourCustomPermissionName', 'CustomPermission', 'Protected');`

**To unhide custom permissions and custom objects in released packages:**

- `System.FeatureManagement.changeProtection('YourCustomPermissionName', 'CustomPermission', 'Unprotected');`
- `System.FeatureManagement.changeProtection('YourCustomObjectName__c', 'CustomObject', 'Unprotected');`

**See Also**

- [Protected Components in Managed Packages](https://developer.salesforce.com/docs/atlas.en-us.pkg1\_dev.meta/pkg1\_dev/packaging_protected_components.htm)
- [*Metadata API Developer Guide*: CustomObject](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/customobject.htm)
- [*Apex Reference Guide*: Feature Management Methods, changeProtection](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_System_FeatureManagement.htm#apex_System_FeatureManagement_changeProtection)
