You want to export your Mastodon account data but keep sensitive media marked as such. The standard export archive does not preserve the “sensitive” flag on media files you have manually set or received. This article explains how to create an export that retains the sensitive media marking using Mastodon’s built-in tools and a manual workaround.
Mastodon stores the sensitive flag as a property of individual statuses, not of the media files themselves. When you request a full data export via Preferences > Import and Export > Request your archive, the resulting JSON files include the sensitive field for each status. However, the media files in the archive are not renamed or tagged visibly. This guide shows you how to extract the sensitive statuses from the archive and how to reapply the flag when importing to a new instance.
Key Takeaways: Exporting Mastodon Account with Sensitive Media Marked
- Preferences > Import and Export > Request your archive: Generates a ZIP file containing JSON data and media files, but media filenames do not indicate the sensitive flag.
- outbox.json file in the archive: Contains the
sensitivefield for each status that had sensitive media. You can parse this file to identify which media needs the flag. - Manual re-marking on the new instance: After importing the archive to a new Mastodon account, you must individually toggle the sensitive flag on each status that was marked sensitive in the original account.
How Mastodon Stores the Sensitive Flag for Media
Mastodon treats the sensitive media flag as a per-status boolean, not a per-file attribute. When you upload an image or video and check the “Mark media as sensitive” box, the status object stores "sensitive": true in the database. The media attachment record itself does not carry the flag independently. This design means that when you export your data, the media files are stored in the media_attachments folder of the archive ZIP with their original filenames and no visible indicator of sensitivity.
The export archive includes a JSON file called outbox.json that contains an array of all your statuses. Each status object includes a sensitive field and a list of attachment objects. The attachment objects contain the URL of the media file as it appeared on the original instance. By cross-referencing the sensitive field with the attachment URLs, you can determine which media files in the archive should be flagged as sensitive.
Steps to Export Mastodon Account Data with Sensitive Media Marked
Follow these steps to request your archive, locate the sensitive statuses, and prepare the data for reimporting with the flag preserved.
- Request your data archive from Mastodon
Log in to your Mastodon account. Go to Preferences > Import and Export > Request your archive. Mastodon generates a ZIP file containing your statuses, media files, and other data. Depending on the size of your account, this may take several minutes. You will receive a notification when the archive is ready to download. - Download and extract the archive ZIP file
Click the download link in the notification. Save the ZIP file to your computer. Extract the contents using a ZIP utility such as 7-Zip or the built-in Windows extraction tool. Inside you will see folders likemedia_attachmentsand files such asoutbox.json,likes.json, andactor.json. - Open the outbox.json file to find sensitive statuses
Openoutbox.jsonin a text editor such as Notepad++ or Visual Studio Code. Search for"sensitive": trueto locate statuses that had sensitive media. Each matching section will also contain an"attachment"array with objects that have a"url"field. The URL ends with the filename of the media file in themedia_attachmentsfolder. - Copy the sensitive media filenames to a separate list
Create a new text file namedsensitive_files.txt. For each status with"sensitive": true, copy the filename from the"url"field. For example, if the URL ishttps://example.com/media_attachments/files/123/456/789/original/abc.jpg, the filename isabc.jpg. Save the list. - Import the archive to your new Mastodon account
Log in to your new Mastodon instance. Go to Preferences > Import and Export > Import. Select theoutbox.jsonfile from your archive. Choose the import type “Mastodon” and click Upload. Mastodon will recreate your statuses, but the sensitive flag will not be automatically applied to the media. - Manually mark sensitive media on the new instance
Go to your profile on the new instance and locate each status that corresponds to a filename insensitive_files.txt. Click the three-dot menu on the status and select Edit. Check the box labeled “Mark media as sensitive” and save the changes. Repeat for all affected statuses.
Common Issues When Exporting Mastodon Account with Sensitive Media
Statuses are imported but media files are missing in the new instance
The import process only transfers the text and metadata of your statuses. Media files must be re-uploaded manually or fetched from the original instance. If you still have access to the original account, you can download the media files from the media_attachments folder in your archive and upload them to the corresponding statuses on the new instance using the Edit function.
The outbox.json file is too large to open in a basic text editor
Accounts with thousands of statuses may produce an outbox.json file exceeding 100 MB. Use a JSON-aware editor such as Visual Studio Code with the JSON extension, or use a command-line tool like jq to filter for sensitive statuses. For example, the command jq '.orderedItems[] | select(.sensitive == true) | .attachment[].url' outbox.json outputs the URLs of sensitive media attachments.
No sensitive media flag appears in the outbox.json at all
If you never marked any media as sensitive in your original account, the sensitive field will either be absent or set to false. Check your original account’s preferences to ensure the feature was used. Mastodon does not retroactively apply the sensitive flag to media that was uploaded without it.
Mastodon Archive Export Options: Sensitive Flag Preservation
| Item | Standard Export (Request your archive) | Manual Re-marking on New Instance |
|---|---|---|
| Preserves sensitive flag in export file | Yes, in outbox.json as a boolean field | No flag is applied automatically |
| Media filenames indicate sensitivity | No, filenames are unchanged | Not applicable |
| Time required for a 500-status account | 5-10 minutes to generate and download | 30-60 minutes to manually re-mark |
| Risk of missing a sensitive status | Low if you search outbox.json correctly | High if you rely on memory alone |
You can now export your Mastodon account data and preserve the sensitive media flag by cross-referencing the outbox.json file with the media attachment filenames. After importing the archive to a new instance, manually reapply the flag to each affected status using the Edit function. For large accounts, use jq or a similar tool to automate the identification of sensitive statuses and reduce manual effort.