Bangla Nice Slug

By Jahedul Islam

10+ active installationsVersion 1.2.0

Very simple Bangla slug sanitizer: Bangla titles get clean Latin-letter permalinks.

Description

With this plugin your canonical URL will be in simple Latin letters even if your post title is in Bangla.

This creates simple link URLs for browsing and sharing.

  • Works for posts, pages, categories, tags and any other content that gets a slug.
  • Titles without Bangla characters are left to WordPress, exactly as without the plugin.
  • Common words are looked up in a built-in dictionary (bnwordmap.dat); everything else is transliterated by rule.

Installation

  1. Install the plugin using the WordPress auto-installer, or download the .zip file from wordpress.org and install it from the Plugins section of your Dashboard, or copy the bangla-nice-slug directory into wp-content/plugins.
  2. Activate the plugin from the Plugins section of your Dashboard.

After activation, your slug sanitization will be active.

FAQ

Do my existing posts keep their URLs?

Yes. Slugs that are already saved are never changed. Posts that already have a Bangla (percent-encoded) slug stay reachable. Only new titles/slugs are transliterated.

What happens to titles in other languages?

Nothing: if a title contains no Bangla characters, the plugin does not touch it and WordPress handles it as usual.

Something looks wrong with the dictionary.

If bnwordmap.dat is missing or damaged, the plugin keeps working using rule-based transliteration. With WP_DEBUG enabled, a message is written to the PHP error log.

Changelog

1.2.0

  • Compatibility: works on PHP 8.x and current WordPress (tested up to 7.1). Fixes the dictionary silently not loading on PHP 8, a fatal error on titles with invalid UTF-8, and PHP 8 warnings/deprecations.
  • Performance: the dictionary and transliteration rules are built once per request, and only when a title actually contains Bangla. Titles without Bangla are skipped immediately.
  • Titles without Bangla are no longer altered by the plugin (accented letters and other scripts are handled by WordPress as usual).
  • Existing posts with Bangla slugs stay reachable: slug lookups are no longer transliterated.
  • HTML tags and entities are removed before transliteration, so “&” no longer turns into “amp” in the slug.
  • Safer dictionary loading: no object instantiation from the data file; a missing or corrupt file is logged (WP_DEBUG) and the plugin falls back to rule-based transliteration.
  • Loading a second copy of the plugin no longer causes a fatal “cannot redeclare” error.

1.1

Release Version