How to use SVG images in WordPress

How to use SVG images in WordPress

WordPress blocks SVG uploads by default because SVG files can contain code, which could be used to attack a site.

To allow them safely:

  1. Go to Plugins › Add New Plugin and search for Safe SVG.
  2. Install and activate it.
  3. Upload SVGs through the Media Library as normal.

Safe SVG cleans each file as it's uploaded, removing scripts and other risky content. You can restrict uploads to administrators in its settings.

Only upload SVGs from sources you trust, and avoid code snippets that allow SVGs without sanitising them.

    • Related Articles

    • How to use AVIF images in WordPress

      AVIF is an image format that's often much smaller than JPEG or WebP for the same quality, helping pages load faster. Check support WordPress supports AVIF uploads from version 6.5 if the server's image library supports it. Go to Tools › Site Health › ...
    • How to fix WordPress images not displaying

      1. Check the image file In Media › Library, open the image and visit its File URL. A 404 means the file is missing; upload it again. 2. Check permissions In File Manager, wp-content/uploads and its folders should be 755 and image files 644. 3. Check ...
    • How to install WordPress

      You can install WordPress in a few clicks from cPanel. Option 1: WordPress Toolkit (recommended) In cPanel, open WordPress Management (WP Toolkit) in the Domains section. Click Install. Choose the domain and, if needed, a sub-folder. Leave the folder ...
    • How to reset your WordPress password

      Option 1: Lost password link Go to yourdomain.co.uk/wp-login.php and click Lost your password? Enter your username or email address. Follow the link in the email to set a new password. If the email doesn't arrive, check spam, then try one of the ...
    • How to clear LiteSpeed Cache in WordPress

      If changes you've made to your site aren't showing, clear the cache. Clear everything In the WordPress admin bar at the top, hover over the LiteSpeed Cache icon and click Purge All. The same button is on the LiteSpeed Cache › Dashboard page. Clear ...