Post title not displaying as recorded in the wp_posts table
I have a WordPress install in which the “post_title” field from the “wp_posts” table is not making it into the WP_Post->post_title variable.
So, for a given post in the wp_posts table that has a correct post_title value of say (retrieved via a direct MySQL query):
"My First Post"
Retrieving the post title via any basic WordPress method, such as:
<?php print the_title(); ?>
… or …
<?php $this_post = get_post(); print $this_post->post_title; ?>
Instead of the post’s title I get something like:
"Category | Sitename"
(Where “Category” is something like “Articles” and “Sitename” is the site’s name)
The resulting string from querying the post’s tile is not the contents of the post_title field from the record in the wp_post table, ie. it’s NOT the post’s title.
I would expect to see the post’s title here because the documentation for the WP_Post object (https://developer.wordpress.org/reference/classes/wp_post/) states that the post_title member contains the post’s title, however it clearly does not, it contains some other value.
I’ve searched for any references to a filter which might be rewriting the post title, but as of yet can find none.
How is it possible that WordPress might be returning something other than the actual post title when referencing the post title? Where else should I be looking?