Title: Custom Character Set
Last modified: February 27, 2023

---

# Custom Character Set

 *  Resolved [Rajon Ahmed](https://wordpress.org/support/users/engrrajonahmed/)
 * (@engrrajonahmed)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/custom-character-set/)
 * Is it possible to change the default character set using custom function?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Tyler](https://wordpress.org/support/users/tylerthedude/)
 * (@tylerthedude)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/custom-character-set/#post-16525518)
 * Hi Rajon,
 * Thank you for reaching out. Just to ensure I’m providing you with the right information,
   are you referring to changing the character set on your site’s database tables?
   If so, then this should be possible by reaching out to your hosting provider.
   If you’re hosting your own server, then you could change the character set by
   following these steps: [https://codex.wordpress.org/Converting_Database_Character_Sets](https://codex.wordpress.org/Converting_Database_Character_Sets)
 * Kind regards,
 *  Thread Starter [Rajon Ahmed](https://wordpress.org/support/users/engrrajonahmed/)
 * (@engrrajonahmed)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/custom-character-set/#post-16526095)
 * Custom character set for short URL slug. Is it available in free or I have to
   buy the pro?
 *  [Tyler](https://wordpress.org/support/users/tylerthedude/)
 * (@tylerthedude)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/custom-character-set/#post-16526595)
 * Hi Rajon,
 * Thank you for getting back to me. If you’re looking to change the slug used for
   your pretty link, then this can be done by editing the link on the Pretty Links
   page (Wp-Admin -> Pretty Links) and changing the “Pretty Link” field to the new
   slug you’d like to use.
 * I hope this helps!
 * Kind regards,
 *  Thread Starter [Rajon Ahmed](https://wordpress.org/support/users/engrrajonahmed/)
 * (@engrrajonahmed)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/custom-character-set/#post-16969868)
 * Hello,
 * Thanks for such a quick reply and I am really sorry that I didn’t get back to
   you.
 * Actually, I am talking about the following code:
 *     ```wp-block-code
       public static function gen_random_string($length = 4)
         {
           $characters = '0123456789abcdefghijklmnopqrstuvwxyz';
           $string = '';
           $max_index = strlen($characters) - 1;
   
           for($p = 0; $p < $length; $p++)
             $string .= $characters[mt_rand(0, $max_index)];
   
           return $string;
         }
       ```
   
 * The default character set. I don’t want to use the default one. I want to use
   a custom character set and also I don’t want to touch the original code. Because
   in every update I will have to update the character set manually. So, I am looking
   for a function or a way to do it.
 * Feature request: Please add an option in the WordPress admin under Pretty Links
   settings to set custom character set.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Custom Character Set’ is closed to new replies.

 * ![](https://ps.w.org/pretty-link/assets/icon-256x256.png?rev=2503434)
 * [PrettyLinks - Affiliate Links, Link Branding, Link Tracking, Marketing and Stripe Payments Plugin](https://wordpress.org/plugins/pretty-link/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pretty-link/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pretty-link/)
 * [Active Topics](https://wordpress.org/support/plugin/pretty-link/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pretty-link/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pretty-link/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Rajon Ahmed](https://wordpress.org/support/users/engrrajonahmed/)
 * Last activity: [2 years, 10 months ago](https://wordpress.org/support/topic/custom-character-set/#post-16969868)
 * Status: resolved