內容簡介
這個外掛程式可以幫助你管理更好的圖片名稱、標題和 alt 標籤。它不會在資料庫中增加任何內容,且可以在開啟或關閉外掛時不影響網站運作。
問題點在於當你匯入圖片時,WordPress 在創建符合 URL 規範的檔案名稱和標題標籤方面表現不佳,且不會創建 alt 標籤。
這個外掛程式可以:
將檔案名稱轉換成符合 URL 規範的刪節版,刪除不支持字符並將所有字符轉換為小寫字母。它還將把底線轉換為破折號(有太多人將其圖片命名為底線而不是破折號),並將一個或多個空格轉換為破折號。
在創建標題標籤時,它會保留大寫字母和特殊字符 - 同樣,它會將底線轉換為空格。
它會自動創建 alt 標籤(複製標題標籤)。這可能不是您想要的最佳 alt 標籤,但至少您每個圖片都會有一個相關聯的 alt 標籤,因為 alt 標籤對於 SEO 至關重要。
例如,通常情況下,如果你匯入一個名為「berlin_wall.jpg」的圖片,它會被保存為「berlin_wall.jpg」,自動創建一個標題標籤「berlin_wall.jpg」。URL 不符規範,而標題標籤也無法被搜索。您需要手動添加 alt 標籤。
若啟用了這個外掛程式,圖片將被保存為「berlin-wall.jpg」(符合 URL 規範),標題標籤將為「berlin wall」,並自動創建 alt 標籤為「berlin wall」。
另一個例子:我們匯入一個名為「Andy Warhol’s Marilyn」的檔案。通常情況下,該檔案會被保存為「Andy-Warhols_Marilyn.jpg」(再次,並不符合 URL 規範)。標題標籤為「Andy Warhol’s_Marilyn」(同樣,不太能搜索)。
若啟用了這個外掛程式,檔案會被保存為「andy-warhols-marilyn.jpg」,標題為「Andy Warhol’s Marilyn」,alt 標籤為「Andy Warhol’s Marilyn」。
因此,為獲得最佳結果,建議您適當地使用大寫字母並使用空格、破折號或底線將單詞分隔開。
請注意,這個外掛程式不能(尚)讀取心靈,如果您的原始檔案名稱是「georgeWashingtonPresident.jpg」,它將以「georgeWashingtonPresident.jpg」匯入,並且標題和 alt 標籤會是「georgeWashingtonPresident」。即是說,如果您不使用空格、破折號或底線區分單詞,這個外掛程式就無法辨識它們。
這個外掛程式每次匯入新圖片時可以為你省下一至兩分鐘,並確保你的圖片符合 URL 規範,且擁有良好的標題和 alt 標籤。
注意:這個外掛程式不會增加任何 JavaScript、CSS 或對你的資料庫進行更改。
外掛標籤
開發者團隊
原文外掛簡介
This plugin helps you maintain better image names, titles and alt tags. It does not add anything to your database, and can be turned on an off without effect.
The problem: when importing images, WordPress does a poor job in creating url-compliant file names and title tags, and doesn’t create alt tags at all.
This plugin:
converts file names to url-compliant slugs, removing unsupported characters and turning all characters into lowercase. It will also convert underscores into hyphens (too many people name their images with underscores instead of hyphens) and one or more spaces into a hyphen.
It will maintain uppercase characters and special characters when creating the title tag – again, it will convert underscores into spaces.
It will automatically create an alt tag (a copy of the title tag). This might not be the best alt tag for your purposes, but at least you will always have an associated alt tag for every image, as alt tags are crucial for SEO.
For example, normally, if you import an image named “berlin_wall.jpg, it will be saved as “berlin_wall.jpg” and automatically create a title tag “berlin_wall.jpg.” The url is not url compliant and the title tag is non-searchable. You will need to add an alt tag manually.
With the plugin turned on, the image would be saved as “berlin-wall.jpg” (url compliant), and the title tag would be “berlin wall” and an alt tag would automatically be created, “berlin wall.”
Here’s another example – we import a file named “Andy Warhol’s Marilyn”. Normally, the file will be saved as “Andy-Warhols_Marilyn.jpg (again, not url compliant). The title tag is “Andy Warhol’s_Marilyn” (again, not very searchable).
With the plugin turned on, the file is saved as “andy-warhols-marilyn.jpg”, with a title “Andy Warhol’s Marilyn” and an alt tag of “Andy Warhol’s Marilyn.”
So, for best results, name your images using capital letters where appropriate (eg, place or people names), and separate words using either spaces, hyphens or underscores.
Please note the plugin is not (yet) able to read minds, so if your original file is named “georgeWashingtonPresident.jpg”, it will be imported as “georgeWashingtonPresident.jpg” with a title and alt tag of “georgeWashingtonPresident.” That is, the plugin can’t tell which words should be separate words if you don’t…separate them, either with a space, a hyphen or an underscore.
This plugin will save you a minute or two every time you import a new image, will keep your images url compliant and ensure you have good titles and an alt tag for every image.
NOTE: does not add any js, css or make changes to your database.
