跳到内容

URL Shortener by Melk

v1.0.1

Melksedeque Silva · 2026年1月26日 上架

Create short URLs for your WordPress posts, pages, categories, tags, and custom post types automatically.

正在使用
10 以下
评分
暂无
累计下载
526
最近更新
2026年10月9日
需要 WordPress 5.0+已测试到 7.1.5PHP 7.4+

截图

Admin settings page where you can choose post types and taxonomies.
Admin settings page where you can choose post types and taxonomies.
Quick copy button in the posts list table.
Quick copy button in the posts list table.
Bulk generation tool for existing content.
Bulk generation tool for existing content.

URL Shortener by Melk is a lightweight and efficient WordPress plugin that allows you to automatically generate short URLs for your posts, pages, categories, tags, and Custom Post Types. Ideal for sharing on social media and marketing materials.

Features:

  • Automatic Generation: Automatically creates short URLs when publishing new posts.
  • Comprehensive Support: Works with Posts, Pages, Categories, Tags, and Custom Post Types.
  • Quick Copy: “Copy” button directly in the post/term listing in the admin panel.
  • Bulk Generation: Tool to generate short URLs for old content with one click.
  • Performance: Fast redirection resolved only on would-be 404s (no heavy queries), so your pages and posts are never affected.
  • Secure: Validated and secure code, following WordPress best practices.

Developer Notes

  • Namespace: Melk\\UrlShortenerByMelk.
  • Unique prefix: all functions, options, meta keys and hooks use the urlshbym_ prefix, following the WordPress Plugin Handbook recommendations to avoid naming collisions.
  • Options stored in the database:
    • urlshbym_enabled_post_types
    • urlshbym_enabled_taxonomies
  • Meta keys:
    • _urlshbym_short_code on posts
    • _urlshbym_short_code on terms (taxonomies)
  • Database table: {$wpdb->prefix}urlshbym_short_urls is created on activation to store the mapping between short codes and objects.
  • Main hook:
    • urlshbym_short_url_clicked — fired whenever a short URL is accessed, receiving the short code and the internal record ID.
  • Integration helper: urlshbym_get_short_url_for_post( $post_id ) — a global function other plugins (such as Social Kit by Melk) can call via function_exists() to reuse the short URL, with no hard dependency in either direction.
  • Resolution: on template_redirect (priority 1), only when the main query is a 404, a root-level path of 5-7 alphanumeric characters is looked up in the table and redirected with a 301. No rewrite rules are registered.
  • Options also stored: urlshbym_delete_data_on_uninstall, urlshbym_db_version.

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums