WordPress Performance Team Is Working on a Module for SVG Uploads

If you have ever tried to upload an SVG (Scalable Vector Graphics) file for a logo or favicon in WordPress, you may have been astonished to find that it doesn’t work. There is no core support so users rely on plugins like SVG Support (900K+ installs) or Safe SVG (600k+ installs) to upload SVG files to the media library and use them like any other image file.

The main advantage of SVG files is they can scale to any dimension without losing quality. They are also compact and SEO-friendly because they are stored in XML text files that can be crawled and indexed.

WordPress contributors have been discussing adding SVG support for more than nine years. It was talked to death with various proofs of concept and no clear path forward, and the ticket eventually became a place where people periodically stop by and comment that it’s “a goddamn tragedy that WordPress doesn’t support this yet.”

Despite the format having nearly universal support across the web, there are security concerns associated with scripted SVGs, where files might contain a malicious script. Without an SVG sanitizer library, users would be uploading SVG files at their own risk.

In the most recent Performance Team meeting, contributors proposed the idea of working on a new SVG uploads module. They are first aiming to allow users to upload SVG files without scripts and provide an SVG preview in the Media Library.

Although more than a million WordPress users have installed a plugin to add SVG uploads to their sites, none of these plugins are feature plugins. This is why the Performance Team has opted to create a module within the Performance Lab plugin. It allows the team to better test the feature in the wild before proposing it for WordPress core.

Looking at current implementations in plugins, the team found many of them offer more features than the scope of this module would include. The most popular plugins all currently use the SVG Sanitizer library, as does a Drupal module and an integration for TYPO3 CMS.

Performance team contributors have identified WordPress 6.2 as a realistic goal for proposing the module for core. Anyone who wants to contribute can join their efforts on GitHub.


7 responses to “WordPress Performance Team Is Working on a Module for SVG Uploads”

  1. SVG support (finally) arriving is great news; though I don’t think there’s any inherent SEO value to the format just because it’s text-based.

    SVGs might actually be bad for SEO, depending on your context. For example, with complex (inline) SVGs, you can end up with a ton of raw XML content in your document which adds overhead (to transfer, and to rendering). I’ve also seen folks use SVGs in weird ways – particularly when they include text or HTML content – which can cause all sorts of SEO headaches.

    However, loading an SVG as a conventional image (e.g., via an element with an src attribute) isn’t really any different to any other format.

    That said, they can also be great for saving bytes on, e.g., simple illustrations!


Subscribe Via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

%d bloggers like this: