大网数据广告活动
网站运营与故障问答

Is SVG better for SEO than other image formats?

· 52CE 我爱测

While reading an article on the internet I read that SVG is better for SEO than other image formats. How true is that? Also, when adding an SVG image to a website should it be added as <svg> or <img> ?

问题原文

原帖链接 · ardacarofficial · CC BY-SA 4.0

While reading an article on the internet I read that SVG is better for SEO than other image formats. How true is that? Also, when adding an SVG image to a website should it be added as <svg> or <img>?

已采纳解答

原帖链接 · Maximillian Laumeister · CC BY-SA 4.0

In the vast majority of use cases, SVG does not gain any special benefits over the other image formats in terms of SEO. However, SVG images are often smaller than their counterparts in other image formats, improving page load times which benefits SEO indirectly.

One thing that SVGs are not that much better at is letting search crawlers index non-image content embedded within them. While crawlers may index textual content, they do not follow links, and they cannot otherwise make sense of an SVG document's structure.

The question of whether to use <img> or <svg> is mostly equivalent to the question of whether it makes more sense to link your images externally by using <img>, or to inline them by using <svg> (you can also inline them by using <img> with a data URI, but it's not recommended as it increases file size and defeats the purpose of SVG's text-based format). 90% of the time it makes the most sense to link your website's images externally by using the <img> tag.

Also note that inlined SVG images are not eligible for inclusion into Google Image Search, only images with their own path on the server are eligible. So if you want your SVG images to show up in image search, be sure to link them externally using img tags.

There is also a third option for embedding which is to use an <object> tag, but that should be used only for SVGs that have scripting or interactive content, and is beyond the scope of this answer.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2021-09-25)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。