WordPress does not allow uploading SVG files by default, whileSVG SupportThe plug-in canUpload SVG image in WordPress, bring benefits to the website.In this article, Lao Wei shares how to install and set the SVG Support plug-in.
SVG is an open, XML based vector graphics format that supports interactive elements.Use XML to define the file format of vector graphics.
2、 Why SVG
The advantage of SVG images is that they can be resized as needed without affecting image quality.However, the commonly used jpg images are different from png images. After zooming in, you will see many small squares (pixelated). If you compress jpg images, the quality may drop to the point where they cannot be used normally.
SVG is commonly used for logos, icons and simple vector graphics on websites.There is no mass loss even in amplification.
For the same image, SVG files are generally much smaller than jpg, png, etc., so that your website will not be affected by large size images.Vector graphics do not use pixels, so the image will not be pixelated when zoomed in.
More importantly, SVG files can be indexed by Google, which is also good for SEO optimization of website images.
3、 SVG Security
The SVG file contains the XML markup language code.Parse the XML markup language through a browser to display the output on the screen.However, this may be exploited by someone to access user data without authorization, trigger violent attacks or cross site scripting attacks.
Although the advanced mode>cleaning SVG files mentioned above can improve security.However, plug-ins cannot completely prevent malicious code from being uploaded or injected.
A more appropriate solution is to use a secure and reliable website to create SVG files, and limit it to only administrators who can upload SVG files.
4、 SVG Support Plug in Installation Settings
In the WordPress background>Plug in>Install Plug in, search for "SVG Support", install and enable it
Check "Only Administrators" to restrict the permission to upload svg files to administrators, so as to improve security.
If you check Enable Advanced Mode, you will enter more SVG advanced function options.For example, use advanced functions such as CSS animation and inline SVG rendering.
Click the "Save Changes" button to take effect.
If we don't study advanced mode, we can upload SVG images safely now.
5、 Allow to upload SVG manually
If you don't want to install more plug-ins, you can also manually add code to the functon. php file to achieve the same function.
Article name: WordPress allows uploading SVG image plug-in SVG Support Article link:https://www.vpsss.net/28411.html Copyright notice: The resources of this website are only for personal learning and exchange, and are not allowed to be reproduced and used for commercial purposes, otherwise, legal issues will be borne by yourself. The copyright of the pictures belongs to their respective creators, and the picture watermark is for the purpose of preventing unscrupulous people from stealing the fruits of labor.