Has the problem been solved yet? I don’t see any unusual special characters on your website.
Thanks for getting back to us.
This page (in Portuguese) is still full of unusual characters: https://languagecaster.com/?page_id=1158
And this post is an example of many posts that have quotation marks or accents https://languagecaster.com/football-language-to-be-at-it/
- Example: “We are all looking forward to Harrogate on Saturday. We need to be at it and set the tempo.†(Gillingham boss Neil Harris before the big game: (Gillingham FC, August 2023)
- Example: “Teams who come here know they will be in for a tough game and we want opponents thinking that – but if they are, we have to make sure that we’re on it from the first minute.†(Barrow.com November 2020)
The output in the frontend contains the correct information for special characters. Therefore, I would guess that the problem is the database and/or database connection.
Have a look under Tools > Site Health > Info > Database to see what has been read out there. The charset and the collation should contain something with utf8. Then use phpmyadmin to check directly in the database with which character set the tables and columns there are created. This should match what is displayed in Site Health. If something differs here, you have to adjust the DB character set and/or collation in wp-config.php.
It is also possible that the characters are already broken in the database. In this case, restoring a backup that does not yet have the problem would probably help.
Hello and thanks for the reply.
- We have looked at site health and it appears okay – there was no record of anything to do with charset or collation. The only thing that was highlighted was the following which we don’t think is related: A PHP session was created by a
session_start() function call. This interferes with REST API and loopback requests. The session should be closed by session_write_close() before making any HTTP requests.
- We then added code to wp-config.php: below:
<?php
- //Begin Really Simple SSL session cookie settings
- @ini_set(‘session.cookie_httponly’, true);
- @ini_set(‘session.cookie_secure’, true);
- @ini_set(‘session.use_only_cookies’, true);
- //END Really Simple SSL
- // BEGIN A2 CONFIG
- define(‘WP_CACHE’, true);
- define( ‘WPCACHEHOME’, ‘/home/damianf/public_html/wp-content/plugins/wp-super-cache/’ );
- define(‘DISALLOW_FILE_EDIT’, true);
- // END A2 CONFIG
- /** Enable W3 Total Cache Edge Mode */
- define(‘W3TC_EDGE_MODE’, true); // Added by W3 Total Cache
- // ** MySQL settings ** //
- // //Added by WP-Cache Manager
- //Added by WP-Cache Manager
- define(‘DISABLE_WP_CRON’, false);
- define(‘DB_NAME’, ‘damianf_wrdp1’); // The name of the database
- define(‘DB_USER’, ‘damianf_wrdp1’); // Your MySQL username
- define(‘DB_PASSWORD’, ‘K})eL]d.j8t&’); // …and password
- define(‘DB_HOST’, ‘localhost’); // 99% chance you won’t need to change this value
- /** 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’, ” );
- define(‘SCRIPT_DEBUG’, true);
- We also changed settings in cpanel>Software>Select PHP version> selected –
mysqli and mysqind
- From mysqind, nd_mysqli, and nd_pdo_mysql
Neither of these helped unfortunately.
Damian
Hello again,
I wonder if anyone has any other ideas as we still have the same issue. If we do something simple like choosing a different font – would that help? We are using the default in our theme (Megaphone).
Thanks
Damian
This line in your wp-config.php is incorrect:
/** Database charset to use in creating database tables. / define( 'DB_CHARSET', 'utf8' ); /* The database collate type. Don't change this if in doubt. */
I suspect the code should look more like this:
/** Database charset to use in creating database tables.
define( 'DB_CHARSET', 'utf8' );
/* The database collate type. Don't change this if in doubt. */
You are welcome to use the code block for formatting here in the forum, as described here: https://wordpress.org/support/forum-user-guide/block-editor/#code-block
And again the hint:
Have a look under Tools > Site Health > Info > Database to see what has been read out there.
There must be an entry for the charset there, it is in every project for me. If you don’t have it, the question would be which WordPress version are you using?
The message about session_start() could indicate a problematic plugin. I would recommend deactivating it as a test and then seeing if the message disappears. Attention: such messages are also cached. It can take a few hours for this to be updated.
Thank you for responding and apologies for not getting back before now.
Have a look under Tools > Site Health > Info > Database to see what has been read out there.
There must be an entry for the charset there, it is in every project for me. If you don’t have it, the question would be which WordPress version are you using?
I did (finally!) check under Site Health > Info and saw nothing under charset – should there be something written there? If so, what and how would I be able to add something? Sorry for my lack of understanding!
We are using the most up to date version of WordPress (6.6.1). We asked our hosting team (A2) but they were not able to help us apart from suggesting a re-install of an earlier save.
Thanks
Damian
The character set should be mentioned in the Databases section of Site Health. You cannot set this yourself – WordPress recognizes what is there in your hosting.
Have you adjusted the wp-config.php as described?
The tip to go back to an older backup of your project is of course quite practical – if you still have such an old backup available.
Hello and thanks for the response.
Yes, we did add the following to the wp-config.php – does it matter where we add this on the page? (Sorry again for the ridiculous questions!)
Damian
/** Database charset to use in creating database tables.
define( 'DB_CHARSET', 'utf8' );
/* The database collate type. Don't change this if in doubt. */
This code is still faulty and is therefore not executed at all. That would be correct:
/* Database charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8' );
/* The database collate type. Don't change this if in doubt. */
Thank you again
I added the code (above) but no change yet.