Incorrect page title sometimes displays on X - Custom 404 page

Hi –

We have an X – Custom 404 page titled “Whoops!” with custom text content.

It displays properly when an invalid URL is off one of the “higher” level paths, including home, any of the top menu categories on the main nav, individual blog posts, and pages with no parent like Whoops itself. Examples, where I’m adding abcdef to force a 404 error:
http://nexlan.com/abcdef
http://nexlan.com/about-us/abcdef
http://nexlan.com/industry-solutions/abcdef
http://nexlan.com/whoops/abcdef
http://nexlan.com/trees-in-the-forest-of-reports/abcdef (a blog post)

But when the URL is off of a “lower” level sub-menu path, instead of displaying the page title as “Whoops!” it surprisingly displays whatever the title is for the most recent blog post. Earlier today it was displaying “Trees in the Forest of Reports” as the custom 404 page title, and now tonight after our November blog post just went live it’s displaying that post’s title instead, “Year-End Capital Investment Planning”. Examples:

http://nexlan.com/industry-solutions/manufacturing/abcdef
http://nexlan.com/accountmate/modules/payroll/abcdef
http://nexlan.com/resources/newsline/abcdef (the main blog page)

When I deactivate the X – Custom 404 plugin, the default “Oops” page displays properly on all pages.

We’ve had the same custom 404 page since mid-2015 or so. This problem first appeared several months ago after we added a few new sub-pages to the site. While trying things to fix it, the problem went away but we don’t know what we did to fix it. Now it came back a week or two ago immediately after we deleted a page from our site. Specifically, after the page was deleted from one of our sidebar menus (example: http://nexlan.com/accountmate/vertical-solutions/accu-dart/ ) but before the page was deleted from the main nav drop-down menu. Since then, I’ve added a new page to both those menus but nothing changed with the status of the custom 404 problem after that. It’s still displaying the incorrect title.

Hey,

Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

– Link to your site
– WordPress Admin username / password

Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

Credentials attached, thanks.

Hi there,

Looks like it’s pulling the last post as 404 page. Would you mind providing your FTP login credentials as well? I need to test how the 404 is pulling it? I checked on my install and it’s correctly pulling the title and content.

Thanks!

Attaching FTP credentials here.

Hi There,

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/cbXjnt2XOY. 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.

Hi - I checked for a plugin conflict. It’s the Yoast SEO plugin. When Yoast is deactivated the problem goes away; comes back when Yoast is reactivated. We’re running the free version of Yoast. Can you try Yoast on your test site and replicate the problem, to rule out our site’s custom code being another factor?

The custom screencast is very cool. The only coding in WordPress that I do is copy-paste code snippets from your forums for styling, or a few basic things like italic and hrefs. So I can only partially follow what you’re doing there, I apologize – but I do understand your conclusion from the test.

Hi There,

I can confirm the issue exist when YOAST plugin is active. Try checking in with the plugin developer. Unfortunately, if an issue is coming from a third party plugin, it is outside the scope of our support. Thank you for understanding.

Thanks for confirming.

It seems to me that the issue could be caused by X Custom 404 plug-in just as easily as it could be caused by Yoast plug-in? Perhaps X Custom 404 is doing something in a non-standard way in the coding, for example. Yoast is a widely-used, reputable plug-in that’s built well, just like X is.

I’ll try checking in with Yoast and offering them the _landmark-header.php file.

Hello There,

I’ve 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.

Thank you for your understanding.

I had the same issue, We were able to figure it out by editing the yoast “forced suggestion” of a title.

I found a Force Rewrite Titles setting in Yoast, I think this is what you’re referring to? It was set to Disabled by default. I just tried changing it to Enabled. Nothing on the site changed - the problem is still there. Thanks for sharing a relevant suggestion though.

Hi there,

Custom 404 uses template redirect and pull the data from custom 404 page. Any plugin or theme could do that and should be okay, the issue is, should YOAST intercept that process and always put different titles or content? We’ll continue checking on this but since it’s a 3rd party plugin, then would take time to troubleshoot on our developers’ side.

Thanks!

Hy @Rad,
@NexLAN ask the Support of Yoast and here is their anwser.

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.

It’s really awesome if you can fix this issue, i allready have it on my site too.

Regards,

Hi There,

I have submitted this to our issue tracker with the reference link to Yoast’s response as well for further investigation.

Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.