Skip to content
Transforms Chinese character titles into a permalink friendly slug, showing pinyin that can be read by humans and (Chinese) search engines alike.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
admin
assets
css
images
inc
languages
.gitignore
README.md
readme.txt
so-pinyin-slugs.php

README.md

Pinyin Slugs

plugin version

Last updated on 2018.10.29
tested up to WP 5.0
tested up to ClassicPress 1.0.0
Authors: Pieter Bos, Denis Cao
Stable Version (via WordPress Plugins Repository)
Plugin homepage

WordPress plugin that transforms Chinese character titles (of Posts, Pages and all other content types that use slugs) into a permalink friendly slug, showing pinyin that can be read by humans and (Chinese) search engines alike.

Description

The Pinyin Slugs plugin is a fork of the original Pinyin Permalinks plugin by user xiaole_tao who has seemingly abandoned his plugin as he never responded to emails.

The original plugin can basically only be used on Chinese only websites; as soon as you install it on a bi/multilingual site it messes up the slugs of the non-Chinese languages.

This fork has been adapted by my ex-colleague Denis Cao in such a way that the slugs of the non-Chinese language remain untouched and only the Chinese character slugs will be transformed into pinyin.

Chinese characters don't come out good in permalinks. Without the Pinyin Slugs plugin activated, the example post I made for the screenshot will get a slug like this: %e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e4%bc%98%e5%8c%96. With the plugin the slug automatically becomes sousuoyinqingyouhua.

Search engines such as Baidu obviously cannot make much of the first slug, but they can handle pinyin perfectly, especially when it is written as one long string without hyphens or underscores.

So instead of transforming "中国" into two separate words divided by a hyphen or an underscore (the original plugin has this as options), it is best transformed into "zhongguo". The only option Pinyin Slugs therefore has left is the length that you can limit to an x amount of letters. The default is 100, which should be plenty for most.

Gutenberg Compatible

Pinyin Slugs also works with the new WP editor (Gutenberg) although the slugs are only changed upon saving the post/page, not immediately. This has to do with the way this new editor works.

ClassicPress Compatible

Because ClassicPress is forked on WP 4.9.8 the Pinyin Slugs plugin is automatically also compatible with ClassicPress.

WPML Compatible

The Pinyin Slugs plugin has received the WPML Certification of Compatibility.

WPML Certification of Compatibility.

Frequently Asked Questions

Does Pinyin Slugs work with Gutenberg?

Yes, it does (see above), although one caveat is that to be able to see the change of slug, the post/page first needs to be saved. The same applies for edits too.

Does Pinyin Slugs work with ClassicPress?

Yes, it does (see above), as ClassicPress is forked on WP 4.9.8 the Pinyin Slugs plugin is automatically also compatible with ClassicPress.

Known Issues

Pinyin Slugs will not transform existing slugs

Can I use this plugin also for Traditional Chinese?

No, the dictionary part of the plugin only contains Simplified Chinese. If you want, you can check what words the dictionary contains by going into inc/dictionary.php

I have an issue with this plugin, where can I get support?

Please open an issue here on Github

Contributions

This repo is open to any kind of contributions.

License

Donations

Connect with me through

BHI Consulting for Websites

SO WP

Github

LinkedIn

WordPress

Changelog

2.1.4

  • date: October 29, 2018
  • tested up to WP 5.0
  • tested up to ClassicPress 1.0.0

2.1.3

  • date: July 8, 2018
  • tested up to WP 4.9.7

2.1.2

  • date: March 15, 2017
  • add sanitize_title filter once the file has been included as per suggestion of Polylang author @Chouby
  • tidying up

2.1.1

  • date: November 29, 2016
  • remove version check
  • tested up to WP 4.7

2.1.0

  • date: March 10, 2016
  • fix to not ignore alphanumerical characters by vanabel, closes issue #4

2.0.4

  • date: August 7, 2015
  • TWEAK: header settings page; only showed half logo after 2.0.3 update

2.0.3

2.0.2

2.0.1

  • date: April 9, 2015
  • changed logos
  • new banner image for WP.org Repo by Joschko Hammermann

2.0.0

  • date: July 29, 2014
  • due to non-compatibility issues with WP 4.0, complete rewrite of the plugin from the ground up
  • bump minimum required WP version up to 3.8

1.0.1

  • date: December 28, 2013
  • fix reported bug that causes entire admin to be a maximum width of 48rem

1.0.0

  • date: December 26, 2013
  • tested up to WP 3.9-alpha
  • settings page overhaul to better match WP 3.8 style
  • change version number format
  • change links

0.1.3

0.1.2

  • redo version check
  • change Github link
  • add Dutch language files
  • add WPML accreditation

0.1.1

  • separate dictionary.php file
  • add Mandarin Chinese language files
  • edit readme.txt and readme.md
  • fix textdomain issue

0.1

  • First stable release

Screenshots

Preview of settings page as well as when adding a new Post

Plugin Settings in the WordPress backend.

New Post with title in Chinese characters and auto-generated pinyin slug; Baidu Search Results page underneath.

You can’t perform that action at this time.