Svg file format is not actually supported. But this is a serious security issue. Unlike PNG \/ JPG \/ GIF file types, SVG is not a raster image, but a vector. As a result, SVG is exposed to the risk of malicious use of JavaScript. WordPress chooses WordPress not to allow SVG by default. It makes sense from all angles.
The WordPress writer has been talking about SVG for many years, but there are too many angles to solve in order to prevent large-scale security problems. Therefore, the only way to solve this problem is to activate SVG in file format using plug-ins or theme functions. How do I activate SVG images on the WordPress website? Before going to the plug-in section, the functions in the topic directory. Through the PHP file, WordPress can actually enable SVG. This is indeed the fastest method, but because SVG is activated in the original format, it is the least secure.
\/\/Enable SVG file format for WordPress uploads function add_file_type_to_uploads ($file_types) {$new_filetypes = arrange (); $new_filetypes [‘] = \
Another safer option is to use plug-ins. Here are the three most compelling SVG enabled plug-ins in WordPress: Increase SVG support androg SVG support is half the battle. You can also add custom styles, animation effects, and enable restrictions. But all this needs some support. Svg support – you can add SVG files to posts and pages using existing image tags. For example, you can add a new CSS class called \
The main functions of this plug-in include: Enable SVG file management in WordPress media library. Convert the uploaded SVG image into in-line code. Supports image artifacts for adding ALT and caption tags to all SVG images. Use custom CSS to specify the style of a single SVG image. Use CSS 3 and JavaScript to achieve animation effects. The detailed setting page in the plug-in dashboard. Perform permission based access. Example: restrict uploads only to accounts with administrator privileges. Although the plug-in provides, the risk of malicious use of SVG is quite realistic. Do not enable SVG file management for untrusted users. Therefore, ideally, only administrator level users can enable this feature.
In other words, anyone with upload permission can upload a new SVG file, but the SVG file is based on XML, so it may be maliciously used through malicious injection. Safe SVG androg safe SVG is one of the plug-ins you can use safely when you are worried about potential security risks. The plug-in is specially designed to delete new SVG uploads and prevent malicious intentions. Safe SVG also adds the ability to view the types of SVG files uploaded through the media library. Use safe SVG with 50000 active users to provide excellent performance for security performance. There are two different versions of this plug-in
。 Free and charged. The free version includes the function of deleting new uploads, and support for SVG view will be added to the media library. After you go to the pro version, you can get additional functions such as svgo optimization. This optimization technology further reduces the file size uploaded by SVG. In addition, Pro allows you to choose which users can upload new SVG files and which users cannot. Therefore, access can only be restricted to specific users. Finally, after purchasing the plug-in, you can access advanced support. You can answer questions when you need them most. You need to use the first two plug-ins we listed to get reasonable results. However, if you like the idea of using shortcodes to add SVG to your site, check the plug-in. The plug-in adds some SVG functions to WordPress and uses SVG Technology, which is based on the idea of Alex ten. This way of including SVG images in HTML seems to be the best combination of performance and compatibility at present. By adding full SVG support, you can upload SVG and generate shortcut code. You can also use custom CSS to customize the style of each SVG element. You can specify some or all of the last uploaded SVG replacement photos. What are the other useful SVG plug-ins for WordPress? In addition to adding SVG support to the WordPress site, are there any other plug-ins that can help the site? I know that everyone and their grandmother have considerable performance advantages. In addition to the file size, the browser also provides the ability to render vector graphics as inline. WP SVG icon male icon is a visual element, which tends to inject new life into the design. Interestingly, the plug-in is for personal needs. The author hopes to implement more SVG files in his own design, but he has not found a solution. So he spent time and effort making the WP SVG icon. The plug-in is very easy to use and can replace existing icons on the site with just a few clicks. Most importantly, as long as the maximum width is set, all images on the retina display do not need to be reconstructed. The icon size will be adjusted automatically. Like the author, the plug-in is excellent for all types of development, multi site and client operations. There are no restrictions, so you don’t have to worry about topic compatibility or similar issues. In addition, it also provides an advanced version, which can upload custom icons. Therefore, it is not limited to integration icons. Svg social menu androg SVG image widget that displays social media icons. To launch the plug-in, simply create a new word press menu with links to social media profiles. Then select the custom SVG social menu location and save the new menu. You can then use the SVG social menu widget in the sidebar or other widget preparation areas of your blog. Currently available icons are plus. Google, WordPress, Facebook, twitter, dribble, pinterest, GitHub, Tumblr, youtube, Flickr, Vimeo, instagram, LinkedIn, Xing \/ feed, mailto and other websites and platforms. Svg logo and text effect androg slate is a plug-in that can activate shortcut code support to add custom SVG effects. Use this plugin to promote a strong brand image, highlight CTA components or highlight elements in a unique way
。 Smart usage supported by quick code means that you can edit and customize effects at a given time. For example, you can mix colors, fonts, and filters, and take advantage of a large number of hatch patterns that make your design compelling. Slate provides the same creative freedom as vector editing software, but does not need to use software! So, what are the main functions? Text. Generate quick code, which can copy SEO friendly text effect and attract eyeballs at the same time. Very similar to what you saw in the snapshot above. typeface. Don’t you know where to get custom fonts? Slate pre packaged a huge Google font library, so don’t worry. Fill mode. The text is filled by the selected hatch pattern. Hatch patterns contain parameters. Control various sizes, distances, and colors to create unique deformations or make the defaults work. There’s more! The plug-in is a powerful tool that can style text and logos very accurately. So is SVG. Where can I find SVG graphics? What can you do without prior knowledge of vector graphics design? Fortunately, finding SVG recently is both simple and easy. At most, you only need to reconnect to the original author who created the drawing. Many platforms offer free images without displaying the author. Here are some amazing websites that offer free SVG content: Font awesome – font awesome is the coolest Font Icon Library in the world. The project has been developing vigorously for many years, providing in-depth support not only for browsers, but also for specific frameworks and design software. This accessibility oriented font package is an absolute killer and easy to use! In fact, I’m sure there are 12 WordPress plug-ins that support font awesome! Vectezy vectezy must be the largest vector graphics platform on earth. Vectezy provides vectors that can be used in any category, shape, or format based on custom design, community contributions, and web-based data. And the file is also very easy. Simply relink the file to the imported creator page. This is the website I often use. Svg background – are you following the latest web design trends? We are exploring too many creative areas of design. One area is the SVG context. You saw them, too. Wavy patterns, curves, etc. Use this site to create an easy to access SVG background! Svg Grabber – this Chrome extension is an absolute gift for importing SVG images from various website pages. Simply click the icon and the extender can import all individual SVG files on the page. Of course, you must follow copyright rules wherever possible, but overall, this seems to be a powerful extension that can be used often. Vector logo area – depending on the gap market, vector based logo collections of the world’s top brands may be useful. You can also use this file for specific releases or promotions. Moreover, most picture editors can convert SVG files to PNG and so on. And it touches the surface of what we actually exist. Personally, SVG has changed a lot in the way of website design and recommended image generation. Svg can handle color spectrum, alignment of various shapes, etc. Of course, this is not the same as using beautiful real-life photos, but on a given website, you can find many places to replace JPG with vector graphics. And how to use SVG in word press.
The goal of this post is to provide a comprehensive overview. The judgment of whether we have achieved our goal will be left to you. If you want to add something to this post or have other resources to share, please note that the comments section is always open.