Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes displays current post title instead of 404 page title #8271

Closed
AnnRochelle opened this issue Nov 15, 2017 · 3 comments
Closed

Sometimes displays current post title instead of 404 page title #8271

AnnRochelle opened this issue Nov 15, 2017 · 3 comments

Comments

@AnnRochelle
Copy link

  • [x ] I've read and understood the contribution guidelines.
  • [x ] I've searched for any related issues and avoided creating a duplicate issue.

Please give us a description of what happened.

Our custom 404 page’s title displays correctly if the invalid URL is at the top menu level. BUT if the invalid URL is deeper at a sub-menu level, then instead of displaying the correct 404 page title, the title of the current post is displayed. Examples below.

We’re using X Theme and their X Custom 404 plug-in for a custom 404 page. When I deactivate Yoast SEO, the problem is resolved.

When I deactivate X Custom 404 plug-in, and instead install and activate 404page plug-in using the same existing 404 page, it too, has the problem, but then when I deactivate Yoast SEO the problem is resolved. Also tried setting a different existing page to be the 404 page with 404page; no luck.

When there is no custom 404 plug-in activated (i.e. X Custom 404 and 404page are both deactivated), the regular non-custom 404 page displays site-wide.

In Yoast SEO, Force Rewrite Titles was set to Disabled by default. When I try changing it to Enabled, the problem remains the same. (Another user on X Theme's support forum posted that they had the same issue and changing the Force Rewrite Titles solved it for them.)

Prior to posting in the Yoast SEO support forum, I posted a ticket with X Theme. Once we narrowed it down to Yoast SEO + X Theme, the support person confirmed that adding Yoast SEO to their test site replicated the problem on their end. Then they said since it's a plug-in issue I need to go to the plug-in company. I replied that actually it could be X Theme as well causing the problem - perhaps X is doing something in a non-standard way in the code for example - but that I'd try contacting Yoast. Then the support person replied that they "submitted this to our issue tracker so the developers will be made aware of it. They will also take note on this issue for them to have a further investigation."
Here is an entry from them earlier in that support thread before we narrowed it down to Yoast, that may help you narrow it down to a function - I'm not a coder so their screencast didn't make sense to me (and it's now deleted):

"Thank you for the credentials.
First I have check child theme, htaccess and with the same version of custom 404 with my test site and it is working.
Since the part that handles the title is this file:
wp-content\themes\x\framework\legacy\cranium\headers\views\ethos\ _landmark-header.php
I have made a copy of that file on your child theme here to check functionality:
wp-content\themes\x-child\framework\legacy\cranium\headers\views\ethos\ _landmark-header.php
I add a sample text to check if it is going to the correct filter. I can confirm it's correct. See this comparison: https://screencast-o-matic.com/watch/cbXjnt2XOY1. My test site is showing custom text and the correct page title but then your site seems to get still the post title. Something is happening from this function then the_title();.

Would you mind checking for a plugin conflict? You can do this by deactivating all third party plugins, and seeing if the problem remains. If it's fixed, you'll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time. Let's just see if there's something from the plugin that causing this issue. Let us know how it goes. The file is still there on your child theme but I remove the customize text so it will function as it is."

Please describe what you expected to happen and why.

I expected all page not found errors to display our custom 404 page no matter where they occur on the site.

How can we reproduce this behavior?

Examples of this on our site, where I’m appending abc here to force a 404 error –

  1. Correct custom 404 page title of Whoops! is displayed
    http://nexlan.com/abc
    http://nexlan.com/accountmate/abc
    and a post, http://nexlan.com/trees-in-the-forest-of-reports/abc

  2. Incorrect custom 404 page title that’s our most current post title, Year-End Capital Investment Planning, is displayed
    http://nexlan.com/accountmate/modules/accounts-payable/abc and
    http://nexlan.com/industry-solutions/manufacturing/abc
    (Each time we add a new post, the newest post title becomes the incorrect 404 page title.)

Technical info

  • WordPress version: 4.8.3
  • Yoast SEO version: 5.7.1 (free version) while troubleshooting and documenting this. Just updated to 5.8 a moment ago and confirmed that the 404 page title issue is still there.
  • Relevant plugins in case of a bug: Yoast SEO
@Scatcherbot
Copy link

Scatcherbot commented Nov 19, 2017

Seems you've fixed it, how?

/Edit, sorry my fault, i clicked the false one ^^'
I have the same Issues :/

Regards

@benvaassen
Copy link
Contributor

When I look at your source code by going to view-source:http://nexlan.com/accountmate/modules/accounts-payable/abc we can see the output of our plugin with the correct title name:

image

Something else outputs the wrong title, see:

image

Therefore, I don't think this is an issue we are able to fix. If it is, we'd invite the developers of X-theme to work together with us on a fix. For now, I'm closing this issue.

For support questions you can always use the following channels:

@AnnRochelle
Copy link
Author

Thank you. Just FYI - I updated my X Theme support forum thread to include this thread; also another X Theme user reported the same issue. X Theme replied 7 days ago, "I have submitted this to our issue tracker with the reference link to Yoast's response as well for further investigation."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants