![](https://i-blog.csdnimg.cn/blog_migrate/e9741c22fed0e98606bb0aa853057753.png)
搜索引擎优化seo
Are you looking to improve image SEO on your website? When optimized properly, image search can bring many new visitors to your website.
您是否要改善网站上的图像SEO? 经过适当优化,图像搜索可以吸引许多新访问者访问您的网站。
To benefit from image SEO, you need to help search engines find your images and index them for the right keywords.
要从图片SEO中受益,您需要帮助搜索引擎找到您的图片并为正确的关键字建立索引。
In this beginner’s guide, we will show you how to optimize image SEO by following top best practices.
在此初学者指南中,我们将向您展示如何通过遵循最佳最佳实践来优化图像SEO。
![Image SEO guide for beginners Image SEO guide for beginners](https://i-blog.csdnimg.cn/blog_migrate/82cc89e66c201a7704e1de4ec3f4c018.png)
Here is a brief overview of what you’ll learn in this article.
这是您将在本文中学到的内容的简要概述。
- Optimizing your images for SEO and Speed针对SEO和速度优化图像
- What is Alt text?什么是替代文字?
- Difference between Alt text vs title替代文字与标题之间的区别
- Difference between alt text and caption替代文字和标题之间的区别
- How to add alt text, title, and caption to images in WordPress如何在WordPress中为图片添加替换文字,标题和标题
- When to use captions for images何时为图像使用字幕
- Disable attachment pages in WordPress禁用WordPress中的附件页面
- Additional tips to improve image SEO改善图片SEO的其他提示
针对SEO和速度优化图像 (Optimizing Your Images for SEO and Speed)
Speed plays an important role in SEO and user experience. Search engines consistently rank fast websites higher. This is also true for the image search.
速度在SEO和用户体验中起着重要作用。 搜索引擎始终将快速网站排名更高。 对于图像搜索也是如此。
Images increase your overall page load time. They take longer to download than text, which means your page loads slower if there are several large image files to download.
图片会增加您的整体页面加载时间。 它们下载所需的时间比文本所需的时间长,这意味着如果要下载多个大型图像文件,则页面加载速度会较慢。
You need to make sure that images on your site are optimized for web. This can be a little tricky to get used to since many beginners are not experts in graphics and image editing.
您需要确保您的网站上的图像针对网络进行了优化。 由于许多初学者都不是图形和图像编辑方面的专家,因此习惯起来可能有些棘手。
We have a handy guide on how to properly optimize images before uploading them to your website.
在将图像上传到您的网站之前,我们提供了有关如何正确优化图像的便捷指南。
The best way to optimize images is by editing them on your computer using a photo editing software like Adobe Photoshop. This allows you to choose the right file format to create a small file size.
优化图像的最佳方法是使用Adobe Photoshop等照片编辑软件在计算机上对其进行编辑。 这使您可以选择正确的文件格式来创建较小的文件大小。
You can also use an image compression plugin for WordPress. These image optimizer plugins allow you to automatically reduce file size while uploading an image to WordPress.
您还可以为WordPress使用图片压缩插件 。 这些图像优化器插件可让您在将图像上传到WordPress时自动减小文件大小。
什么是替代文字? (What is Alt Text?)
Alt text or alternative text is an HTML attribute added to the img
tag which is used to display images on a web page. It looks like this in plain HTML code:
Alt文本或替代文本是添加到img
标签HTML属性,用于在网页上显示图像。 用纯HTML代码看起来像这样:
<img src="/fruitbasket.jpeg" alt="A fruit basket" />
<img src="/fruitbasket.jpeg" alt="A fruit basket" />
It allows website owners to describe the image in plain text. The main purpose of the alternate text is to improve accessibility by enabling screen readers to read out the alt text for visually impaired users.
它允许网站所有者以纯文本形式描述图像。 替代文本的主要目的是通过使屏幕阅读器能够为视障用户读出替代文本,从而提高可访问性。
Alt text is also crucial for image SEO. It helps search engines understand the context of the image.
替代文字对于图像SEO也是至关重要的。 它有助于搜索引擎了解图像的上下文。
Modern search engines can recognize an image and it’s content by using artificial intelligence. However, they still rely on website owners to describe the image in their own words.
现代搜索引擎可以使用人工智能来识别图像及其内容。 但是,他们仍然依靠网站所有者以自己的语言描述图像。
Alt text also accompanies images in Google image search, which helps users understand the image and improves your chances of getting more visitors.
在Google图片搜索中,图片还附带有替代文字,可帮助用户理解图片并增加吸引更多访问者的机会。
![Alt text used in search results Alt text used in search results](https://i-blog.csdnimg.cn/blog_migrate/c8171c375f1158d05e531e305a373bfe.png)
Usually, alt text is not visible on your website. However if an image is broken or cannot be found, then your users will be able to see the alternate text with a broken image icon next to it.
通常,alt文本在您的网站上不可见。 但是,如果图像损坏或找不到,则您的用户将能够看到旁边带有残破图像图标的替代文本。
![Alternate text displayed next to a broken image Alternate text displayed next to a broken image](https://i-blog.csdnimg.cn/blog_migrate/fbfe0bc0db141a07378ab128fb6ad26a.png)
替代文字和标题之间有什么区别 (What is the Difference Between Alt Text vs Title)
Alt text is used for accessibility and image SEO, while title field is used internally by WordPress for media search.
替代文字用于辅助功能和图像SEO,而标题字段由WordPress内部用于媒体搜索。
![Search image by title Search image by title](https://i-blog.csdnimg.cn/blog_migrate/d47a4b3983cbaef7b9cc097110c3765d.png)
WordPress inserts the alt tag in the actual code used to display the image. The title tag is stored in the database to find and display images.
WordPress在用于显示图像的实际代码中插入alt标签。 标题标签存储在数据库中以查找和显示图像。
In the past, WordPress inserted the title tag in the HTML code as well. However, it was not an ideal situation from the accessibility point of view, which is why they removed it.
过去,WordPress也在HTML代码中插入了标题标签。 但是,从可访问性的角度来看,这不是理想的情况,这就是他们删除它的原因。
替代文字和标题之间有什么区别 (What is the Difference Between Alt Text vs Caption)
The alt text is used to describe the image for search engines and screen readers. On the other hand, the caption is used to describe the image for all users.
替代文字用于描述搜索引擎和屏幕阅读器的图像。 另一方面,标题用于描述所有用户的图像。
Alt text is not visible on your website while captions are visible below your images.
替换文字在您的网站上不可见,而标题在图像下方可见。
![Example of a caption displayed below an image Example of a caption displayed below an image](https://i-blog.csdnimg.cn/blog_migrate/0b4ec4fa3c27f4e9ce73ed46145b0e7c.png)
The alt text is crucial for better image SEO on your website. The caption is optional and can be used only when you need to provide additional information about the image to website visitors.
替代文字对于在您的网站上获得更好的图像SEO至关重要。 该标题是可选的,仅当您需要向网站访问者提供有关图像的其他信息时才可以使用。
如何在WordPress中为图片添加替代文本,标题和标题 (How to Add Alt Text, Title, and Caption to Images in WordPress)
Alt text, title, and caption make up the image metadata that you can add to images when uploading them into WordPress.
替代文字,标题和标题构成了将图像上载到WordPress中时可以添加到图像的图像元数据。
When you add an image using the default image block, WordPress allows you to add caption and alt text for the image.
使用默认图像块添加图像时 ,WordPress允许您为图像添加标题和替代文本。
![Adding alt text and caption to an image in WordPress Adding alt text and caption to an image in WordPress](https://i-blog.csdnimg.cn/blog_migrate/ee4dbc7e81120bb59b10e7315a9598a8.png)
It automatically generates a title for the image from the file name. You can change the title by clicking on the edit button in the image block’s toolbar.
它会根据文件名自动为图像生成标题。 您可以通过单击图像块工具栏中的“编辑”按钮来更改标题。
![Editing an image in default WordPress editor Editing an image in default WordPress editor](https://i-blog.csdnimg.cn/blog_migrate/506380af7a65714bd96d17f12dc4ffed.png)
This will bring up the media uploader popup where you can enter your own custom title for the image.
这将弹出媒体上传器弹出窗口,您可以在其中输入图像的自定义标题。
![Changing image title in WordPress Changing image title in WordPress](https://i-blog.csdnimg.cn/blog_migrate/55d0b808f5670e9c169cf86a83d42d75.png)
You can also edit the alt tag and title for the images that you have already uploaded to WordPress. To do that, you need to visit Media » Library page and locate the image you want to edit.
您还可以编辑已经上传到WordPress的图像的alt标签和标题。 为此,您需要访问Media»Library页面,然后找到要编辑的图像。
![WordPress media library WordPress media library](https://i-blog.csdnimg.cn/blog_migrate/42b7782ec4e8dd09122002cd1332ce83.png)
Simply clicking on an image will bring up the attachment details popup where you can enter title, alt text, and caption.
只需单击图像,将弹出附件详细信息弹出窗口,您可以在其中输入标题,替代文本和标题。
![Add alt tag and title via media library Add alt tag and title via media library](https://i-blog.csdnimg.cn/blog_migrate/bec49af6db223dde8ccf7fd90bcc167c.png)
Note: Changing an image’s alt tag or caption via Media Library will not change it in the posts and pages where the image is already used.
注意:通过媒体库更改图像的alt标签或标题不会在已经使用该图像的帖子和页面中对其进行更改。
何时在WordPress中使用图片字幕 (When to Use Captions for Images in WordPress)
Captions allow you to provide additional details for an image to all your users. They are visible on the screen for all users including search engines and screen readers.
通过字幕,您可以向所有用户提供图像的其他详细信息。 所有用户(包括搜索引擎和屏幕阅读器)在屏幕上都可以看到它们。
![An image gallery with captions for each image An image gallery with captions for each image](https://i-blog.csdnimg.cn/blog_migrate/68892559c82da1f050130c3953d8a8c0.png)
As you may have noticed that most websites don’t normally use captions with images in their blog posts or pages. That’s because captions are often not needed to explain an image.
您可能已经注意到,大多数网站通常不会在其博客文章或页面中使用带图片的标题。 这是因为通常不需要字幕来解释图像。
Captions are more suitable in the following scenarios:
字幕在以下情况下更合适:
- Family or event photos 家庭或活动照片
- Photos that need additional explanation describing the background story 需要额外说明背景故事的照片
- Product image galleries 产品图片库
In most cases, you would be able to explain the image in the article content itself.
在大多数情况下,您将能够在文章内容本身中解释图像。
禁用WordPress中的附件页面 (Disable Attachment Pages in WordPress)
WordPress creates a page for all images you upload to your posts and pages. It is called the attachment page. This page just shows a larger version of the actual image and nothing else.
WordPress为您上传到帖子和页面的所有图像创建一个页面。 这称为附件页面。 此页面仅显示实际图像的放大版本,仅此而已。
This can have a negative SEO impact on your search rankings. Search engines consider pages with little to no text as low quality or ‘thin content’.
这可能会对您的搜索排名产生负面的SEO影响。 搜索引擎将没有或几乎没有文本的页面视为低质量或“内容稀疏”。
This is why we recommend users to disable the attachment pages on your website.
这就是为什么我们建议用户禁用您网站上的附件页面的原因。
The easiest way to do this is by installing and activating the Yoast SEO plugin. For more details, see our step by step guide on how to install a WordPress plugin.
最简单的方法是安装并激活Yoast SEO插件。 有关更多详细信息,请参阅有关如何安装WordPress插件的分步指南。
Upon activation, it automatically turns off attachment URLs. You can also manually turn off attachment pages in WordPress by visiting SEO » Search Appearance page and clicking on the Media tab.
激活后,它将自动关闭附件URL。 您还可以通过访问SEO»搜索外观页面,然后单击媒体选项卡来手动关闭WordPress中的附件页面。
![Disable attachment URLs in WordPress Disable attachment URLs in WordPress](https://i-blog.csdnimg.cn/blog_migrate/8b1a43dd18bc9669e1a4cfa9af167cf2.png)
From here, make sure that the ‘Media & attachment URLs’ option is set to ‘Yes’.
在此处,确保将“媒体和附件URL”选项设置为“是”。
If you are not using Yoast SEO plugin, then you can install the Attachment Pages Redirect plugin. This plugin simply redirects people visiting the attachment page to the post where the image is displayed.
如果您不使用Yoast SEO插件,则可以安装“ 附件页面重定向”插件。 这个插件只是将访问附件页面的人重定向到显示图像的帖子。
You can also do this manually, by adding the following code to your theme’s functions.php file or a site-specific plugin.
通过将以下代码添加到主题的functions.php文件或特定于站点的插件中 ,您也可以手动执行此操作。
function wpb_redirect_attachment_to_post() {
if ( is_attachment() ) {
global $post;
if( empty( $post ) ) $post = get_queried_object();
if ($post->post_parent) {
$link = get_permalink( $post->post_parent );
wp_redirect( $link, '301' );
exit();
}
else {
// What to do if parent post is not available
wp_redirect( home_url(), '301' );
exit();
}
}
}
add_action( 'template_redirect', 'wpb_redirect_attachment_to_post' );
改善图片SEO的其他提示 (Additional Tips to Improve Image SEO)
Adding alt tag is not the only thing you can do to improve image SEO. Following are a few additional tips that you should keep in mind when adding images to your blog posts.
添加alt标签并不是改善图像SEO的唯一方法。 以下是在向博客帖子中添加图像时应牢记的一些其他技巧。
1. Write descriptive alt text
1.撰写描述性替代文字
Many beginners often just use one or two words as alt text for the image. This makes the image too generic and harder to rank.
许多初学者通常只使用一个或两个单词作为图片的替代文本。 这使图像过于通用,难以排名。
For example, instead of just ‘kittens’ use ‘Kittens playing with a yellow rubber duck’.
例如,使用“小猫和黄色橡皮鸭一起玩 ” ,而不只是“小猫 ” 。
2. Use descriptive file names for your images
2.为图像使用描述性文件名
Instead of saving your images as DSC00434.jpeg, you need to name them properly. Think of the keywords that users will type in the search to find that particular image.
无需将图像另存为DSC00434.jpeg,您需要正确命名它们。 想一想用户将在搜索中键入以找到该特定图像的关键字。
Be more specific and descriptive in your image file names. For example, red-wooden-house.jpeg is better than just house.jpeg.
在图像文件名中更具体和更具描述性。 例如, red-wooden-house.jpeg比house.jpeg好 。
3. Provide context to your images
3.为图像提供上下文
Search engines are getting smarter every day. They can recognize and categorize images quite well. However, they need you to provide context to the image.
搜索引擎每天都变得越来越聪明。 他们可以很好地识别和分类图像。 但是,他们需要您为图像提供上下文。
Your images need to be relevant to the overall topic of the post or page. It is also helpful to place the image near the most relevant text in your article.
您的图片必须与帖子或页面的整体主题相关。 将图像放在文章中最相关的文本附近也很有帮助。
4. Follow the SEO best practices
4.遵循SEO最佳做法
You also need to follow the overall SEO guidelines for your website. This improves your overall search rankings including image search.
您还需要遵循网站的整体SEO指南 。 这可以提高您的整体搜索排名,包括图像搜索。
5. Use original photographs and images
5.使用原始照片和图像
There are many free stock photography websites that you can use to find free images for your blog posts. However, the problem with stock photos is that they are used by thousands of websites.
有许多免费的库存摄影网站,您可以使用这些网站来查找博客文章的免费图像 。 但是,库存照片的问题在于它们被数千个网站使用。
Try to use original photographs or create quality images that are unique to your blog.
尝试使用原始照片或创建博客独有的高质量图像。
We know that most bloggers are not photographers or graphic designers. Luckily, there are some great online tools that you can use to create graphics for your websites.
我们知道,大多数博客作者都不是摄影师或平面设计师。 幸运的是,有一些很棒的在线工具可用于为网站创建图形 。
We hope this article helped you learn about Image SEO for your website. You may also want to see our guide on how to fix common image issues in WordPress.
我们希望本文能帮助您了解网站的Image SEO。 您可能还希望查看有关如何解决WordPress中常见图像问题的指南。
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在Twitter和Facebook上找到我们。
翻译自: https://www.wpbeginner.com/beginners-guide/image-seo-optimize-images-for-search-engines/
搜索引擎优化seo