[WordPress] 外掛分享: Disable Media Pages

前言介紹

  • 這款 WordPress 外掛「Disable Media Pages」是 2020-12-30 上架。
  • 目前有 10000 個安裝啟用數。
  • 上一次更新是 2024-07-25,距離現在已有 282 天。
  • 外掛最低要求 WordPress 5.2 以上版本才可以安裝。
  • 外掛要求網站主機運作至少需要 PHP 版本 7.1 以上。
  • 有 17 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

joppuyo |

外掛標籤

hide | media | remove | disable | attachment |

內容簡介

這個 WordPress 外掛完全停用「附件」頁面。

預設情況下,WordPress 會為每個附件建立一個頁面。這可能會有兩個不利因素:

搜尋引擎優化

附件頁面除了一張圖片外,沒有任何內容,因此幾乎沒有價值並可能會對 SEO 造成負面影響,因為它們是所謂的低質內容。甚至更糟糕的是,附件頁面有時可能會比實際內容頁面排名更高,這會導致糟糕的使用者體驗。

保留規範

附件頁面可能會意外保留站點上的規範。假設您上傳了一張名為 contact.jpeg 的圖片,WordPress 將自動創建一個附件頁面 https://example.com/contact。如果您稍後嘗試創建一個名為 Contact 的頁面,該頁面的網址將成為 https://example.com/contact-2,這並不好。

作法

這個外掛會自動將所有附件規範設置為唯一的 ID,以避免衝突。如果存取附件頁面,該外掛會設置 404 狀態碼並顯示「頁面不存在」的樣板。

您還可以對現有的任何附件規範進行調整,以免在未來造成任何問題。

感謝

特別感謝 Greg Schoppe 的研究和靈感,對開發這個外掛有很大的幫助。

支援外掛

維護 WordPress 外掛是一項艱鉅的工作。如果您喜歡這個外掛,請考慮在WordPress.org上評分。您也可以在GitHub 贊助者上支持我。謝謝!

如果您有興趣,也可以查看我的其他 WordPress 外掛:

Disable Customizer
Disable Drop Cap
ACF Image Aspect Ratio Crop

原文外掛簡介

Completely disable “attachment” pages created by WordPress.
By default, WordPress creates a page for each of your attachments. This is can be undesirable because of two reasons:
Search engine optimization
Attachment pages don’t have any content, except an image, so they provide little value and can negatively affect your SEO because they are so-called thin content. Even worse, attachment pages may in some cases rank higher than your actual content pages which leads to a poor user experience.
Reserved slugs
Attachment pages can accidentally reserve slugs on your site. Let’s say you upload an image named contact.jpeg, an attachment page https://example.com/contact is automatically created. If you then try to create a page named Contact, the URL for that page will be https://example.com/contact-2 which isn’t that great.
How it works
This plugin works by automatically setting all attachment slugs to an unique id, so they won’t conflict with your pages. If an attachment page is accessed, the plugin will set a 404 status code and display the “page not found” template.
You can also mangle any existing attachment slugs so they won’t cause any issues in the future.
WP CLI support
The plugin supports WP CLI.
Mangle existing attachment slugs
wp disable-media-pages mangle

Restore attachment slugs
wp disable-media-pages restore

Note for WordPress 6.4
WordPress 6.4 includes a new feature that allows you to disable attachment pages. However, this feature redirects attachment pages to the file URL instead of returning a 404 error. To completely disable attachment pages, you should use this plugin instead. The WP 6.4 feature also does not fix the issue where attachment pages reserve slugs for pages.
Also, there is not user interface to enable or disable media pages, they are automatically disabled for new sites but remain enabled for existing sites.
Because of these issues, I recommend you to use this plugin instead of the built-in feature. The plugin will be updated in the foreseeable future, at least until attachment pages are completely removed from WordPress core and older WordPress versions are no longer in use.
Thanks
Special thanks to Greg Schoppe for his research and inspiration that helped a lot with developing this plugin.
Support the plugin
Maintaining a WordPress plugin is a lot of work. If you like the plugin, please consider rating it on WordPress.org. You can also support me on GitHub sponsors. Thank you!
If you are interested, you can also check out my other WordPress plugins:

Disable Customizer
Disable Drop Cap
ACF Image Aspect Ratio Crop

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Disable Media Pages」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


1.0.2 | 1.0.3 | 1.0.4 | 1.0.6 | 1.0.7 | 1.0.8 | 1.1.0 | 1.1.1 | 1.1.2 | 1.1.3 | 1.2.0 | 1.2.1 | 1.2.2 | 1.2.3 | 1.3.0 | 2.0.0 | 2.0.1 | 2.0.2 | 2.0.3 | 3.0.0 | 3.0.1 | 3.0.2 | 3.0.3 | 3.0.4 | 3.0.5 | 3.1.0 | 3.1.1 | 3.1.2 | 3.1.3 | trunk |

延伸相關外掛(你可能也想知道)

  • WP Ghost (Hide My WP Ghost) – Security & Firewall 》Hide My WP Ghost 是一個 WordPress 安全外掛,透過強大且易於使用的功能,提供最佳的安全解決方案。它可以在不改變任何目錄或檔案的情況下,將網站的安全性...。
  • Email Encoder – Protect Email Addresses and Phone Numbers 》專門為電子郵件地址設計的全站保護外掛,可防止垃圾郵件機器人、電子郵件收割機和其他機器人攻擊。無需任何配置。, 此外,使用我們集成的[eeb_protect_conten...。
  • If Menu – Visibility control for Menus 》藉由可見度規則,您可以控制網站訪客看到哪些選單項目。以下是一些範例:, , 僅顯示選單項目,當 使用者已登入, 當裝置為行動裝置時,隱藏選單, 顯示選單 給...。
  • Dynamic Visibility for Elementor 》Dynamic Visibility 擴充套件讓您可以隱藏小工具、欄位、容器、區段或頁面。, 當您正在建立不想向所有人展示的內容時,這尤其有用。, 這是一個 Elementor 的...。
  • Hide/Remove Metadata 》Hide/Remove Metadata是一款免費、簡單而非常實用的WordPress外掛,能夠幫助您輕鬆地隱藏或刪除網站上的作者和發布日期。該外掛非常容易使用,僅提供隱藏或移...。
  • Hide Admin Bar 》這個 WordPress 外掛可以隱藏 WordPress 3.1+ 的管理員工具列,感謝 Yoast 和 Pete Mall 的貢獻。如果你喜歡這個外掛,可以考慮請買我一杯咖啡。。
  • WordPress Hide Posts 》這個外掛可以讓你隱藏首頁、分類頁、搜索頁、標籤頁、作者頁、RSS Feed、REST API、文章導覽和原生最近文章小工具的任何文章。, 試試看 Demo, 功能:, , 使用...。
  • Hide My Site 》選擇一個密碼以保護整個 WordPress 網站,只有知道此密碼的訪客才能存取您的 WordPress 網站。這是一個完美的工具,適合建立 WordPress 網站開發版本或者任何...。
  • Hide Featured Image 》有些情況下,我們可能想在某個單獨的文章頁面上顯示特色圖片,但另一些文章頁面則不想顯示。, 這個外掛可以讓您在單獨的文章頁面上顯示或隱藏特色圖片,同時...。
  • WP-ShowHide 》預設情況下,內容是隱藏的,使用者必須點擊「顯示內容」連結來切換內容。與 Engadget 為他們的新聞稿所做的方式相似。範例用法:[showhide type="pressreleas...。
  • WP Mailto Links – Protect Email Addresses 》這個外掛可以安全地保護和編碼電子郵件地址,以防止垃圾郵件機器人、亂發郵件和其他機器人。此外,它很容易使用,不需要進行任何配置即可使用。, 功能, , 全...。
  • WP Hide Post 》這個外掛強在幫助你完全控制文章的顯示方式。在 WordPress 網誌上,一般加入的文章會顯示在首頁中,通常是第一篇位置,也會同樣顯示在分類、標籤、存檔頁面等...。
  • Hide Shipping Method For WooCommerce 》s offering “Free Shipping” and “Local Pickup” on the cart page. With the Hide Shipping Method for WooCommerce plugin, you can hide all other shippi...。
  • Hide Categories and Products for Woocommerce 》這個外掛可以讓你隱藏選定的類別上的店鋪產品,並隱藏類別本身,無論是在列表還是單獨頁面中。, 它可以與 Storefront(主題)短代碼兼容。, 使用方式, , 前往...。
  • AH Display Widgets 》這個外掛可以讓你輕鬆在特定頁面中隱藏小工具。在每個小工具中新增核取方塊,以便在每個網站頁面上顯示或隱藏它。, 在不同的頁面、分類、自訂分類及 WPML 語...。

文章
Filter
Apply Filters
Mastodon