[WordPress] 外掛分享: Yeshuahin Alternative Post URLs

首頁 › 外掛目錄 › Yeshuahin Alternative Post URLs
WordPress 外掛 Yeshuahin Alternative Post URLs 的封面圖片
全新外掛
安裝啟用
—
尚無評分
4 天前
最後更新
—
問題解決
WordPress 5.0+ PHP 7.2+ v1.0 上架:2026-11-25

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Yeshuahin Alternative Post URLs」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Long post titles make long links. Yeshuahin Alternative Post URLs gives every post an alternative, shorter URL that is easy to copy, share and print, while the normal permalink keeps working. The short URL contains only the post’s main category and its post ID:
https://example.com/bangkok/20/

The URL stays valid when the post title or slug changes, because the ID never changes.
Features

Works alongside your existing permalinks, with no redirect: the short URL shows the post directly and the normal permalink is used as the canonical URL for search engines.
Uses the primary category set in Yoast SEO, Rank Math or SEOPress. Without one it uses the post’s first category.
Shows the alternative URL in a new “Alt URL” column in the Posts list, with a Copy button, and in a box in the post editor.
Shortcode [alt_post_url] prints the alternative URL of the current post, or of a given post with [alt_post_url id="123"].
No rewrite rules and no settings. It never needs a permalink flush and will not take over pages, date archives or other URLs: it only answers when the first part is an existing category and the second is the ID of an existing post.
If permalinks are set to Plain, the alternative URL has the form /?category_name=bangkok&p=20.

For developers

yhh_altpost_get_url( $post ) returns the alternative URL of a post.
yhh_altpost_main_category filter changes the category used in the URL.
yhh_altpost_redirect_to_permalink filter, return true to redirect the alternative URL to the normal permalink.

延伸相關外掛

文章
Filter
Mastodon