How to upload SVG icons in WordPress


I’m the SEO specialist at Webcodebuilder and ZEMEZ, companies that create templates powered by Gutenberg WordPress editor and Elementor page builder . We also have ZeGuten multipurpose plugin, which expands Gutenberg's possibilities.

How to create responsive columns WordPress layouts
Prev post
  • May 06, 2020
  • 3 min read
  • 4,702

How to upload SVG icons in WordPress

Nowadays each website uses visual content for a bunch of ideas. Featured images for posts, backgrounds for slider carousels, icons for listings – and it’s not even a half of purposes. The most popular image formats are JPEG, PNG, SVG for icons WordPress, and GIF, however, most developers still face one important question.

What format is worth using: SVG vs PNG

SVG is a special image format, also knows as vector graphics. It supports animation, transparency, and gradients. Whereas, PNG is a raster image format used for images in high quality. It also supports transparency, however, doesn’t support animation.

Modern websites are usually overloaded with content, so your images need to weigh less, which will help your website load faster. The main advantage of the SVG format is that it is very compressible and lightweight.

Moreover, SVG icons look good on every screen. Unfortunately, we can’t say the same about PNG format. The resolution of PNG images is limited, and so is the color pallet. Also, such images can’t be animated like SVGs.

Furthermore, SVG content has a lot more pros:

  • each modern browser support SVG format;
  • designers can create simple SVGs in a code or text editor, or export them from Adobe Illustrator, Figma or Sketch;
  • you can insert text into SVG image as a separate layer – that will make them easy to search;
  • if you want to edit SVG, you can do it via the CSS code: simply change the needed parameters;
  • it doesn’t matter how many times you save an object – it won’t affect the original quality. 

How to upload SVG icons in WordPress webpage using a special plugin

By default, WordPress doesn’t support the SVG format. However, you can do it via the plugin.

Uploading SVGs with the help of the plugin is the fastest way. To do this, you simply need to go to the admin dashboard of your website and open the Plugins tab. Here you need to click on the Add New button and type “SVG” in the search field.

add plugin SVG icons wordpress

In this tutorial, we are going to show you how to upload SVG icons in WordPress based on the SVG Support plugin. Find this one and click on the Install button. After that, you have to activate this plugin.

After that, go to the Settings > SVG Support. You have to check the box next to the Restrict to Administrators option. This step will allow you to upload SVG icons in WordPress.

In case you want to apply some additional CSS settings, like animation, to your SVG icon, you can also turn on the advanced mode.

set options SVG icons wordpress

Now let’s try to upload an SVG image to any page of your website. Go to any page of your website and create a listing. You can do this with the help of ZeGuten plugin, which provides you with 14 amazing blocks, and the Icon list block is one of them.

Add a listing by clicking on the “+” icon and fill it up with content. After that, you need to click the Select image button and upload SVG file from your PC or media library.

upload svg

After that, you become able to vary the icon size without quality loss.

change size SVG icons wordpress

Sanitizing SVGs

This method of uploading SVGs also requires a plugin and allows you to perform the sanitization of SVG files uploaded to WordPress.

First and foremost, you have to return to the Plugins > Add New. Search for the Safe SVG plugin, install and activate it. This plugin allows any user who writes posts on your WordPress website, use SVG files.

This plugin is a so-called sanitizer, which solves a bunch of security issues. Safe SVG won’t allow you to upload unsanitized files and stop SVG/XML vulnerabilities affecting your website.

Let’s compare two blocks default columns and ZeGuten Section block
Next post
How to create responsive columns WordPress layouts
Prev post
Let’s compare two blocks default columns and ZeGuten Section block
Next post

Get Gutenix Subscription

Create unlimited Gutenberg, Brizy and Elementor websites with dozens of templates, premium blocks and a lightweight theme — all in one toolkit!

Meet Gutenix, the devoted team of developers that stands behind many projects created with Elementor & Gutenberg. We're inspired by WordPress, and are always looking for an opportunity to make WordPress easier for everyone.
Copyright © 2024 Gutenix. All Rights Reserved.