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

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

  1. Why has it taken NINE YEARS for this is beyond me! I’ve used plugins for this in the past, but I hate doing it, as adding additional plugins, can slow the site(s) down.

    Here is to hoping that SVG support becomes core in WordPress soon.

    • If we add every feature people want then the WP zip package is going to be petabytes in size.

      For some of us techo geeks, it might be good (the SVG thing) but for the average blogger…not really.

      • TIL svg is for techno geeks, while seeing a terrible error while uploading a popolar format in a CMS that is supposed to be user friendly is perfectly fine.

  2. It’s existed for years with full SVG support… Sometimes it’s not even funny how behind things can be…

    Enable SVG Uploads

  3. 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!

Newsletter

Subscribe Via Email

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

%d bloggers like this: