Delete items

As a user of ArcGIS, you may need to remove items from your content library. Whether it's maps, layers, or web applications, the ability to delete items is part of maintaining an ArcGIS portal environment. In this section, you will explore the process of deleting items, highlighting the steps and considerations.

Why delete items

You delete items to:

  • Remove items that are no longer needed and not being used by anyone in the organization.
  • Maintain an organized environment by removing outdated or redundant content.
  • Allow users who are using an item the time to find a replacement by first marking the item as deprecated before deleting it.

How to copy items

The general steps of transferring item ownership:

1. Access your content

Content page

Content page displaying items in a portal.

Sign in to your portal and ensure that you have administrative privileges to manage content within your organization.

Go to the Content tab where you can view all the content available in your organization.

2. Select the item

Content page

Content page displaying selected items in a portal.

To find and select an item, you can follow one of these methods:

  • Use the search bar at the top of the page to enter keywords related to the item you're looking for.
  • You can browse through your content by clicking on the Content tab on the top navigation bar.
  • You can filter your content by type, owner, or other criteria to locate the specific item more efficiently.

Once you find the item, click on it to open its details page, where you can view its properties and perform various actions.

3. Delete the item

Content page

Click Delete to delete the selected items.

To delete a the selected item, you can go to the item's details page, disable delete protection, and click the Delete Item button. Additionally, to delete multiple items, you select the items in the Content page and click Delete. Deleting an item removes it completely from the organization and ArcGIS Online.

There are key differences between deleting a single item and deleting multiple items in ArcGIS portal:

  • Deleting a single item:

    • You can delete a single item from its details page by disabling delete protection and clicking the Delete Item button.
    • This method allows you to delete one item at a time.
  • Deleting multiple items:

    • To delete multiple items more efficiently, you can go to the Content page, select the items, and click Delete.
    • This batch delete method allows you to delete multiple items at once, which is more efficient than deleting them one by one.

4. Verify

After deleting an item, it is important to verify the deletion was successful and that the item is no longer accessible within your organization. To do this, you can follow these suggestions:

  • Once item is deleted, confirm the item is not available by navigating to the location where the item was previously stored.
  • Use the search functionality within portal to search for the deleted item by its title, keywords, or other identifying information.
  • If the deleted item had dependencies, such as hosted feature layers or web maps that were used in applications, verify that these dependencies are still functional.

Code examples

Delete an item

Below is an example that demonstrates how to delete an item in ArcGIS Online:

ArcGIS API for PythonArcGIS API for PythonArcGIS REST API
Expand
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
item_id = 'your_item_id_here'  # Replace 'your_item_id_here' with the actual item ID

# Get the item
item = gis.content.get(item_id)

# Delete the item
delete_result = item.delete()
Expand

Delete multiple items

Below is an example that demonstrates how to delete multiple items in ArcGIS Online:

ArcGIS API for PythonArcGIS API for PythonArcGIS REST API
Expand
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
item_ids = ['item1_id', 'item2_id', 'item3_id']  # Replace with the actual item IDs

# Loop through each item ID and delete it
for item_id in item_ids:
    try:
        item = gis.content.get(item_id)
        item.delete()
        print(f"Item '{item.title}' (ID: {item.id}) deleted successfully.")
Expand

Verify privileges to delete items

Below is an example that demonstrates how an organization administrator can verify if a user has the proper privileges to delete items:

ArcGIS API for PythonArcGIS API for PythonArcGIS REST API
Expand
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
    # Check if the user has the necessary privileges to delete items
    if user.role == "org_admin" or user.role == "user_type_publisher":
        print(f"The user '{username_to_check}' has the necessary privileges to delete items.")
    else:
        print(f"The user '{username_to_check}' does not have the necessary privileges to delete items.")
Expand

Tutorials

Import data to create a feature layer

Use data management tools to import files and create a feature layer in a feature service.


Define a new feature layer

Use data management tools to define and create a new empty feature layer in a feature service.


Manage a feature layer

Use a hosted feature layer item to set the properties and settings of a feature layer in a feature service.


Create a vector tile service

Use data management tools to create a new vector tile service from a feature service.


Create a map tile service

Use ArcGIS Online or scripting APIs to publish a map tile service.


Services

API support

Use data management tools or Client APIs to create, manage, and access data services. The table below outlines the level of support for each API.

CreateManageAccess
ArcGIS Maps SDK for JavaScript1
ArcGIS Maps SDK for Kotlin1
ArcGIS Maps SDK for Swift1
ArcGIS Maps SDK for Java1
ArcGIS Maps SDK for .NET1
ArcGIS Maps SDK for Qt1
ArcGIS API for Python
ArcGIS REST JS
Esri Leaflet2
MapLibre GL JS23
OpenLayers23
Full supportPartial supportNo support
  • 1. Use portal class and direct REST API requests
  • 2. Access via ArcGIS REST JS
  • 3. Requires manually setting styles for renderers

Tools

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.