How to Upload SVG files in Wordpress (Without any Plugin) | Add Vector Images to WordPress

Sdílet
Vložit
  • čas přidán 21. 06. 2021
  • This video will show you how to upload SVG files in WordPress. Here, I will cover two methods to enable the support of SVG image files in WordPress.
    One is by adding a Plugin and the other method is by adding a PHP code in the theme editor.
    #SVG stands for Scalable Vector Graphics which is an Extensible Markup Language-based vector image format for two-dimensional graphics. SVG images and their behaviours are defined in XML text files.
    #Wordpress doesn't support the upload of SVG files as it may create security risks but you can bypass this by following this video.
    ✅ Download the PHP code: key2blogging.com/enable-svg-s...
    ✅ Code snippet Plugin: wordpress.org/plugins/code-sn...
    If you have any doubt ask me in the comment section and Subscribe to my channel for more upcoming videos like this.
    Related Videos:
    ✅ How to upload webp images in WordPress (with or without Plugin): • How to Upload WebP ima...
    ✅ Add Author box in GeneratePress (without Plugin): • How to Add Author Box ...
    ✅ Twitter: / key2blogging
    ✅ Telegram: t.me/techyleaf
    ✅ Quora: www.quora.com/profile/Abhishe...
    ✅ Pinterest: / abhishekpadhi666
    Gear I Use -
    Mic: amzn.to/3tOnN7Q
    Wireless mouse: amzn.to/3uP9DVB
    Keyboard: amzn.to/3fk0MVc
    Find more videos at #key2blogging
    #wordpressguide #wordpresstuitorials #imageoptimization

Komentáře • 50

  • @THAIWAK
    @THAIWAK Před rokem

    Very informative. Thank you and stay safe! Martin

  • @debendrapandia1865
    @debendrapandia1865 Před 3 lety

    The coding is working perfectly fine. 👍👍

  • @2000gile
    @2000gile Před 2 měsíci

    using the plugin not solved my problem, but using this method solved my problem. thanks bro

  • @sirhenryhu
    @sirhenryhu Před rokem

    Thank you for sharing. The code works like a charm.

  • @oumaimaelrhazal5649
    @oumaimaelrhazal5649 Před 2 lety

    Thank you so much. It work perfectly

  • @majeedalbadrani
    @majeedalbadrani Před měsícem

    Thank you , can you tell me whwer I shall found SVG development focus file ?

  • @j.s.enterprises9454
    @j.s.enterprises9454 Před 2 lety

    Thankyou it worked correctly with code ..

  • @pt_trainer9244
    @pt_trainer9244 Před 6 dny

    thanks, just addding the plugin is enough to upload svg

  • @sgt.powerpuff3107
    @sgt.powerpuff3107 Před 2 lety

    07.2022... it works. Awesome, thx man

  • @tamjidhossain6957
    @tamjidhossain6957 Před 2 lety

    thank you brother

  • @Sarah-dm5hc
    @Sarah-dm5hc Před rokem

    J'ai copié collé manuellement le code dans le fichier function.php directement depuis le FTP et ça fonctionne :) merci !

  • @writingbee
    @writingbee Před 9 měsíci

    Hey! thanks for this video. Please clarify how to show this svg file on a particular page or category?

    • @Key2Blogging
      @Key2Blogging  Před 9 měsíci

      Just use the media library and choose the svg image as you select other image files like jpg, png

    • @writingbee
      @writingbee Před 9 měsíci

      ok, thanks@@Key2Blogging

  • @martynpage4823
    @martynpage4823 Před 2 lety

    Hi...have a couple of questions...In your example you use an undraw svg....undraw has an extensive library of files and I was thinking of using them in hero images etc...would you use a compressed .jpg file or the svg? Second question..would you use an svg for your logo or compressed .png file?

    • @Key2Blogging
      @Key2Blogging  Před 2 lety

      Svg is always a better option as it provides better quality and less size

    • @martynpage4823
      @martynpage4823 Před 2 lety

      @@Key2Blogging thank you so much for a quick reply....what about the security side of things...is there a plugin to protect us from crap in svg files? What am I looking for if I open up the svg files in illustrator...hope you don't mind the questions....love your videos!

    • @Key2Blogging
      @Key2Blogging  Před 2 lety

      No problem, you can ask all of your doubts.
      Only use svg images from reputed sites like undraw, storyset, freepik etc.
      But, there is some security risk in svg as they are written in html. So, downloading from untrusted sites may create problem.

    • @martynpage4823
      @martynpage4823 Před 2 lety

      @@Key2Blogging In the code for the functions.php file you have a specific function for .thumbnail images...but what about when using for background images 1920 x 1080....Featured images 1200 x 900...900 x 1200....have you functions for those types ....?

  • @ohmyads3d
    @ohmyads3d Před 2 lety

    After a svg graphics was added to a page, is it possible to make it into a button? I.e. react to mouse click?

    • @Key2Blogging
      @Key2Blogging  Před 2 lety +1

      Yes, you can use the svg icon inside a button also.

  • @michellesudhakar9961
    @michellesudhakar9961 Před rokem

    Thanks for the video. What are the benefits of the code over the plugin?
    Thanks for your response

    • @Key2Blogging
      @Key2Blogging  Před rokem +1

      Those who don't want to add a additional plugins and use one code manager plugin for multiple function in wordpress

    • @michellesudhakar9961
      @michellesudhakar9961 Před 11 měsíci

      Perhaps not related to the video but any idea on how to connect my current go daddy site to my home page? It seems to be redirected to a blog page instead of redirecting to my landing page
      Any help is appreciated@@Key2Blogging

  • @jamal.salouni
    @jamal.salouni Před 9 měsíci

    thank you

  • @techbestreview3989
    @techbestreview3989 Před 2 lety

    Thanks

  • @srabeel
    @srabeel Před 2 lety

    I have a problem. I added the logo to the site svg file, but then the colors in the logo are not on there place or position, it looks like it is moving up , please do you have any idea why this happen

    • @Key2Blogging
      @Key2Blogging  Před 2 lety

      It may happen due to existing CSS code written for svg files. Why not you use a Png format for logo.

  • @instant_mint
    @instant_mint Před 6 měsíci

    Thanks. What are the cons of using a plugin for this? It seems easier but at the same time using the code feels like you're "in control" more, so which is best?

    • @Key2Blogging
      @Key2Blogging  Před 6 měsíci +1

      You can use any method you Like. It's just personal preference. Most people don't like to add plugin for simple task like this.

    • @instant_mint
      @instant_mint Před 6 měsíci

      @@Key2Blogging Okay, Thank you!

  • @martynpage4823
    @martynpage4823 Před 2 lety

    Have you any advice about compressing svg files?

    • @Key2Blogging
      @Key2Blogging  Před 2 lety

      Yes, you can compress svg also.

    • @martynpage4823
      @martynpage4823 Před 2 lety

      @@Key2Blogging sorry....I was asking how you go about compressing svg files?

    • @Key2Blogging
      @Key2Blogging  Před 2 lety +1

      Search "compress svg online" and you will see alot of sites to compress this format.

  • @Ponchovogel
    @Ponchovogel Před 2 lety

    works fine with the latest WP. Copy the code into your child-theme function.php

    • @Key2Blogging
      @Key2Blogging  Před 2 lety

      Yes, you can use it in child theme also..

  • @skjelstad777
    @skjelstad777 Před 2 lety +1

    HI, is the code secure?

    • @Key2Blogging
      @Key2Blogging  Před 2 lety +1

      Yes, it is secure and enable svg Upload but always use svg files from trusted source only.
      Because svg files may infected as it is an HTML based file.
      But there is no issue with this function file and it is using most of the svg plugin.

  • @allaboutbodybuilding7619

    sir mere usme ye cide work ni kr raha h
    kya karu sir ab mai

    • @Key2Blogging
      @Key2Blogging  Před 2 lety

      Then Use a plugin like WP SVG Images by shortpixel

  • @Consult_With_Holly
    @Consult_With_Holly Před 4 měsíci

    I've tried everything and nothing I do works

    • @Key2Blogging
      @Key2Blogging  Před 4 měsíci

      Did you try using a Plugin Like svg support

  • @BOOMER989
    @BOOMER989 Před 10 měsíci

    Bhai Mera svg support nhi kar rha aur nahh me kisi ko bhej pa rha pls help me do u have insta ??

  • @MsWazaf
    @MsWazaf Před 7 měsíci

    thank you