Enable Versioning For Sitecore Media Items

March 3, 2022

By David Austin

When it comes to versioning in Sitecore there are some things that are obvious, and some things that are not. You can, at any time, add a version for an item from within Content Editor, selecting the Versions tab and clicking Add. Removing a version is equally as easy by clicking the Remove button.

When it comes to Media items, you can create versions as well. There is a key difference however as Media items come in two flavours, Versioned and Unversioned. By default, whenever you upload a media item it will be identified as Unversioned. It is, however, just a Sitecore item so versions can still be applied.

Upload Versionable Through Advanced Menu Option

If you want to upload a media item and make it versionable, then you can use the Upload files (advanced) option.

Screenshot of the media library item in Sitecore

You can then select Make uploaded media items versionable.

Screenshot of creating media items versionable in in Sitecore

Enabling Media Versioning By Default

Let's say we want to make it such that media items are not only versioned by default but that they have a workflow attached, to maintain the versioning rather than just require the user to Add a new version.

Create A Patch Config

The easiest way to force media versioning is through the use of a config patch file, such as the one below that changes Media.UploadAsVersionableByDefault.

<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
    <sitecore>
    <settings>
        <setting name="Media.UploadAsVersionableByDefault" value="false">
        <patch:attribute name="value">true</patch:attribute>
        </setting>
    </settings>
    </sitecore>
</configuration>

Now when you upload a file normally, it will automatically be assigned as Versioned.

If you desired to add a workflow to an appropriate type or media items as a whole, you would then assign it to one of the Versioned templates listed below. Each type inherits from File.

Screenshot of creating different versions of an item in Sitecore

Image of Fishtank employee David Austin

David Austin

Development Team Lead | 4x Sitecore Technology MVP

David is a decorated Development Team Lead with 4 Sitecore Technology MVPs and Coveo MVP awards, as well as Sitecore CDP & Personalize Certified. He's worked in IT for 25 years; everything ranging from Developer to Business Analyst to Group Lead helping manage everything from Intranet and Internet sites to facility management and application support. David is a dedicated family man who loves to spend time with his girls. He's also an avid photographer and loves to explore new places.