Orchard Core SEO with Media Slugify Enable Media Slugify for Orchard Core SEO.

Orchard Core SEO with Media Slugify

Orchard Core has a really nice media library to store various documents and images to be used as assets for the Orchard Core website. The media library allows one to drag and drop and upload images that may be part of a blog post or photo gallery. These images are stored in the media library without question and can be selected using an Orchard Core MediaField or ContentPickerField for inclusion into various Content Items. The media library UI helps non-technical authors and contributors easily add assets to author and contribute to content for the Orchard Core website.

The Orchard Core media library doesn't question the naming conventions of the documents and images. If you upload an image to Orchard Core that has spaces and other unfriendly SEO characters, the media library will allow you to do so. Although you can offer website training and guidelines to non-technical contributors on how to best name the assets to help with SEO, it's hit and miss as to whether those guidelines are followed when adding content to the media library.

Orchard Core has a built-in solution to help optimize the naming of new assets added to the media library, called Media Slugify. When enabled, Orchard Core's Media Slugify will rename the image before saving it to the media library to remove any spaces and unfriendly SEO characters. If you're interested in Orchard Core SEO, you may want to enable this feature on your Orchard Core website.

Orchard Core Media Slugify

Most of the features in Orchard Core can be enabled and disabled from the Orchard Core Admin Dashboard. Login to Orchard Core as an administrator and navigate to Configuration -> Features. In the list of Orchard Core features is the Media Slugify feature. Unless your Orchard Core Setup Recipe explicitly enables Media Slugify, it will be disabled by default and need to be enabled manually.

Media Slugify Feature for Orchard Core SEO

The description of Media Slugify is self-explanatory: The media slugify module slugifies new folders and files to make them SEO-friendly. Slugify in this context refers to the image (or document) name, which is essentially the slug portion of the URL (route) for the image in the Orchard Core Media Library. Although I won't discuss it in detail in this Orchard Core tutorial, Media Slugify also renames folders in the media library to make them more SEO Friendly. If you add a folder to the media library called "my folder", it will be renamed as "my-folder".

Once you enable Media Slugify all new media added to the Orchard Core Media Library will be renamed to be more SEO friendly. If I drag and drop a new image to the media library called "owl photo (2021).jpg" without Media Slugify, it will have an undesirable slug from a search engine optimization standpoint.

...media/owl%20photo%20(2021).jpg

When I drag and drop the same photo to the Orchard Core Media Library with Media Slugify enabled, the URL will be very SEO friendly for search engines like Google, Bing, etc.

...media/owl-photo-2021.jpg

Media Slugify will not rename existing assets in the Media Library when enabled, which is why it's important to enable it earlier than later when adding content to your Orchard Core website. In many cases, I enable the feature as part of the Orchard Core Theme's Setup Recipe. Media Slugify can easily be disabled later if the feature is undesirable, and enabled and disabled at will depending on the Orchard Core website's needs.

Orchard Core Media Slugify and Azure Blog Storage

Media Slugify runs independently of the underlying media storage. If you're hosting your Orchard Core Media Library on Azure using Azure Blob Storage, Media Slugify will properly optimize the names of new folders and assets being added to the media library for search engines. I have Orchard Core clients successfully using Media Slugify with my Dropbox Media Storage when hosting the Orchard Core Media Library on Dropbox, too. In both cases the names of the folders and images used in the Orchard Core websites are SEO friendly.

Conclusion

If you're an Orchard Core developer or Orchard Core administrator interested in Orchard Core SEO, the Media Slugify feature helps maintain SEO friendly folders and assets for your Orchard Core website. New folders and images added to the Orchard Core Media Library will be renamed (if necessary) to make them more SEO friendly. Media Slugify works when using Azure Blob Storage or other custom media library storage, such as Dropbox Media Storage for Orchard Core. Media Slugify will not change existing folders and images in the media library when enabled. I recommend enabling it when first developing Orchard Core websites as it can easily be disabled and re-enabled at anytime. A great place to enable Media Slugify is in your Orchard Core Theme's Setup Recipe.