Tagged: Special characters
-
AuthorPosts
-
October 14, 2024 at 4:00 pm #1469095
I am having a major issue again throughout one of our sites having ‘special characters’ such as â,€,™, appearing throughout the site including on RSS feeds that can’t be corrected. I’ve tried every iteration of wp-config.php DB_CHARSET settings with
define(‘DB_CHARSET’, ‘utf8’);
define(‘DB_CHARSET’, ‘utf8mb4’);
adding a dash between utf8 (to read like utf-8)
but
I had reported this a long time ago and it worked but now nothing appears to fix the issue. I don’t want to resort to a find/replace plugin since that won’t update the RSS feeds plus those also have the potential to create other issues.details below
Please help
Thank you!!
October 14, 2024 at 4:08 pm #1469098I am having the same problem for a couple websites actually, but not only the RSS feed but also the frontend of the website seems to be having these problems.
When I set define(‘DB_CHARSET’, ‘latin1’); the problems are gone. But if you then edit the page, the problems return.
October 15, 2024 at 5:39 am #1469121Hi,
Thank you for the inquiry.
Have you tried temporarily deactivating the plugins or switching to a default Twenty-XX theme? You may need to contact your hosting provider for additional info or assistance, as this issue is not directly related to the theme.
Best regards,
IsmaelOctober 15, 2024 at 2:54 pm #1469159Thank you Ismael, and thank you Paul. I deactivated each plugin one at a time and cleared cache each time as part of my troubleshooting. I’ll reach out to our hosting provider but can you please confirm what is the recommended setting for these two sections in the wp-config.php:
/** Database Charset to use in creating database tables. */
//define(‘DB_CHARSET’, ‘utf8’);/** The Database Collate type. Don’t change this if in doubt. */
//define(‘DB_COLLATE’, ”);Thank you again for your amazing support, I’ll keep this thread posted to our resolution as well
October 15, 2024 at 4:43 pm #1469172For me, the solution for some websites was to change the collation of my database tables to utf8mb4_general_ci for some websites.
For others, I needed to adding:
define(‘DB_CHARSET’, ‘latin1’);
In wp-config.php
Still strange that some of my Enfold websites (mostly in combination with WP Rocket and Gravity Forms) all of a sudden had these problems, where most of the sites where working fine for years. Disabling the plugins or changing to a default theme also did not work.
My hosting provider said they did not make any changes server-side.
October 16, 2024 at 8:56 am #1469192Hi,
Thank you for the update.
This is the default WordPress settings:
/** Database Charset to use in creating database tables. */ define('DB_CHARSET', 'utf8mb4'); /** The Database Collate type. Don’t change this if in doubt. */ define('DB_COLLATE', '');
For older versions:
/** Database Charset to use in creating database tables. */ define( 'DB_CHARSET', 'utf8' ); /** The Database Collate type. Don't change this if in doubt. */ define( 'DB_COLLATE', '' );
Best regards,
IsmaelOctober 17, 2024 at 6:25 pm #1469329Thank you both for your replies! I had our DBAs update all the tables in the database to use utf8mb4_general_ci
I’ve tried updating the wp-config.php to almost every configuration I could find including Pauls and Ismaels (some examples below)
Paul: You mentioned that the solution for some websites was to change the collation of your database tables to utf8mb4_general_ci. In your wp-config.php, what was your DB_CHARSET and DB_COLLATE for those?
For others, you added: define(‘DB_CHARSET’, ‘latin1’)….what was the collation for those in your wp-config.php?
I oversee several websites and they too where working fine for years. Disabling the plugins or changing to a default theme also did not work for me.Any other suggested resolutions are greatly appreciated. We are unsure what changed since the site has been fine for over 5 years. Thank you!
wp-config.php configuration examples after all the tables in the database were updated to use utf8mb4_general_ci:
1-
/** Database Charset to use in creating database tables. */
define(‘DB_CHARSET’, ‘utf8mb4’);/** The Database Collate type. Don’t change this if in doubt. */
define(‘DB_COLLATE’, ”);2-
/** Database Charset to use in creating database tables. */
define(‘DB_CHARSET’, ‘utf8’);/** The Database Collate type. Don’t change this if in doubt. */
define(‘DB_COLLATE’, ‘utf8_general_ci’);3-
/** Database Charset to use in creating database tables. */
define(‘DB_CHARSET’, ‘utf8’);/** The Database Collate type. Don’t change this if in doubt. */
define(‘DB_COLLATE’, ”);4-
/** Database Charset to use in creating database tables. */
define(‘DB_CHARSET’, ‘utf-8’);/** The Database Collate type. Don’t change this if in doubt. */
define(‘DB_COLLATE’, ”);5-
/** Database Charset to use in creating database tables. */
define( ‘DB_CHARSET’, ‘utf8mb4’ );/** The Database Collate type. Don’t change this if in doubt. */
define( ‘DB_COLLATE’, ‘utf8_general_ci’ );October 17, 2024 at 8:54 pm #1469341Current database tables:
| TABLE_NAME | TABLE_COLLATION |
+————————————————-+——————–+
| wp_blc_filters | utf8mb4_general_ci |
| wp_blc_instances | utf8mb4_general_ci |
| wp_blc_links | utf8mb4_general_ci |
| wp_blc_synch | utf8mb4_general_ci |
| wp_commentmeta | utf8mb4_general_ci |
| wp_comments | utf8mb4_general_ci |
| wp_itsec_lockouts | utf8mb4_general_ci |
| wp_itsec_log | utf8mb4_general_ci |
| wp_itsec_temp | utf8mb4_general_ci |
| wp_layerslider | utf8mb4_general_ci |
| wp_layerslider_drafts | utf8mb4_general_ci |
| wp_layerslider_revisions | utf8mb4_general_ci |
| wp_links | utf8mb4_general_ci |
| wp_ninja_table_items | utf8mb4_general_ci |
| wp_options | utf8mb4_general_ci |
| wp_postmeta | utf8mb4_general_ci |
| wp_posts | utf8mb4_general_ci |
| wp_smush_dir_images | utf8mb4_general_ci |
| wp_term_relationships | utf8mb4_general_ci |
| wp_term_taxonomy | utf8mb4_general_ci |
| wp_termmeta | utf8mb4_general_ci |
| wp_terms | utf8mb4_general_ci |
| wp_usermeta | utf8mb4_general_ci |
| wp_users | utf8mb4_general_ci |
| wp_woocommerce_api_keys | utf8mb4_general_ci |
| wp_woocommerce_attribute_taxonomies | utf8mb4_general_ci |
| wp_woocommerce_downloadable_product_permissions | utf8mb4_general_ci |
| wp_woocommerce_order_itemmeta | utf8mb4_general_ci |
| wp_woocommerce_order_items | utf8mb4_general_ci |
| wp_woocommerce_payment_tokenmeta | utf8mb4_general_ci |
| wp_woocommerce_payment_tokens | utf8mb4_general_ci |
| wp_woocommerce_sessions | utf8mb4_general_ci |
| wp_woocommerce_shipping_zone_locations | utf8mb4_general_ci |
| wp_woocommerce_shipping_zone_methods | utf8mb4_general_ci |
| wp_woocommerce_shipping_zones | utf8mb4_general_ci |
| wp_woocommerce_tax_rate_locations | utf8mb4_general_ci |
| wp_woocommerce_tax_rates | utf8mb4_general_ci |
| wp_wplnst_scans | utf8mb4_general_ci |
| wp_wplnst_scans_objects | utf8mb4_general_ci |
| wp_wplnst_urls | utf8mb4_general_ci |
| wp_wplnst_urls_locations | utf8mb4_general_ci |
| wp_wplnst_urls_locations_att | utf8mb4_general_ci |
| wp_wplnst_urls_status | utf8mb4_general_ci |
| wp_wsal_metadata | utf8mb4_general_ci |
| wp_wsal_occurrences | utf8mb4_general_ci |
| wp_wsal_options | utf8mb4_general_ci |
| wp_yoast_indexable | utf8mb4_general_ci |
| wp_yoast_indexable_hierarchy | utf8mb4_general_ci |
| wp_yoast_migrations | utf8mb4_general_ci |
| wp_yoast_primary_term | utf8mb4_general_ci |
| wp_yoast_seo_links | utf8mb4_general_ci |
| wp_yoast_seo_meta | utf8mb4_general_ci |
+————————————————-+——————–+October 17, 2024 at 9:11 pm #1469342…also tried the following wp-config.php configuration:
6-
/** Database Charset to use in creating database tables. */
define( ‘DB_CHARSET’, ‘utf8mb4’ );/** The Database Collate type. Don’t change this if in doubt. */
define( ‘DB_COLLATE’, ‘utf8mb4_unicode_520_ci’ );7-
/** Database Charset to use in creating database tables. */
define( ‘DB_CHARSET’, ‘utf8mb4’ );/** The Database Collate type. Don’t change this if in doubt. */
define( ‘DB_COLLATE’, ‘utf8mb4_unicode_ci’ );8-
/** Database Charset to use in creating database tables. */
define( ‘DB_CHARSET’, ‘utf8’ );/** The Database Collate type. Don’t change this if in doubt. */
define( ‘DB_COLLATE’, ‘utf8mb4_unicode_ci’ );9-
/** Database Charset to use in creating database tables. */
define( ‘DB_CHARSET’, ‘utf8mb4’ );/** The Database Collate type. Don’t change this if in doubt. */
define( ‘DB_COLLATE’, ‘utf8mb4_general_ci’ );October 17, 2024 at 9:16 pm #1469343…also collation_database is set to utf8mb4_general_ci
also please note that all
define(‘DB_COLLATE’, ”); are indeed with the separation: define(‘DB_COLLATE’, ‘ ‘); but they copy here in the post without the separation
” is ‘ ‘ in wp-configOctober 18, 2024 at 4:27 am #1469350Hi,
Thank you for the update.
Instead of changing the database or character set format, have you tried performing a search and replace? We don’t think this will resolve the issue since the invalid characters are already stored in the database. You can search for the incorrect characters and replace them with the correct ones. This can be done manually or by using the following plugin:
//https://wordpress.org/plugins/better-search-replace/
// https://wordpress.org/plugins/search-and-replace/Please don’t forget to create a site backup before doing the search and replace.
Best regards,
IsmaelOctober 18, 2024 at 8:09 pm #1469414Thank you Ismael for the details.
When you say that ‘We don’t think this will resolve the issue since the invalid characters are already stored in the database.’ are you referring to changing the database/character set format not resolving the issue or to the search/replace not resolving the issue?Thank you
October 21, 2024 at 5:30 am #1469529Hi,
We are referring to changing the character set format. This may not fix the issue for characters or content that are already stored in the database, but it should affect newly created content. Please contact your hosting provider for further assistance.
Thank you for your patience.
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.