Tagged: 404 page
-
AuthorPosts
-
March 4, 2016 at 2:28 pm #593275
Hey guys,
By accident I discovered that a non-existing XML URL like http://kriesi.at/themes/enfold/test.xml, displays a 404 page with default sidebars (e.g.: displays every single page) and default footer widgets (e.g.: “INTERESTING LINKS Bellow are some interesting links for you! Enjoy your stay :)”)
All other non-XML URLs that lead to the 404 page, display the 404 page with my customized sidebar and footer widgets.
I’m using the parent theme’s 404 page, so I haven’t made any modifications to anything related to the 404 page. Nor have I made any code mods to anything related to the sidebar and footer widgets. All widget customizations were made via WP admin’s widgets drag and drop system.
My biggest problem with this is that every single page is being displayed by the pages widgets in the sidebar and footer, which is something I don’t prefer.
Do you have any ideas as to what might be causing the 404 page to display default widgets under the circumstances described above?
Thanks in advance.
Kind regards,
Ralph
March 6, 2016 at 9:50 am #593879Hi,
Does anyone know how the solve the 404 page issue described in my previous post?
Thank you,
Ralph
March 6, 2016 at 2:33 pm #593926Hey!
do you have any plugin like Yoast SEO or something like that activated?
Cheers!
BasilisMarch 6, 2016 at 2:40 pm #593931Yup, I have Yoast SEO activated… do you think this plugin is causing the issue? If yes, can the issue be solved without deactivating Yoast SEO?
March 7, 2016 at 6:40 pm #594530Hey,
Does anyone know why Yoast SEO might be causing the issue? And whether it can be solved without deactivating Yoast SEO?
Thanks,
Ralph
March 8, 2016 at 1:12 pm #594978Hello?
March 9, 2016 at 9:57 am #595414Hey,
Can someone please have a look at the issue?
As stated previously: yes, I’m using Yoast SEO. But why does it cause Enfold’s 404 page to display its default widgets, when an URL ends with “.XML”? And is there a fix for this (besides disabling Yoast SEO)?
Thanks in advance,
Ralph
March 10, 2016 at 10:28 am #596190Hey Kriesi Team,
Can someone please help or at least let me know whether you actually feel like this issue is worth solving or not?
I understand you guys are very busy, but I feel like I’m pretty much talking to myself here for almost a week now :) While I think that in some cases, like in my case, having the default 404 page and its Page Widgets expose every single page, is not a really good idea.
Hoping to hear from you!
Thank you,
Ralph
March 15, 2016 at 6:45 am #598185Hi!
Sorry for the delay. Note that by replying to your own thread, you are bumping it to the end of the queue and we
don’twon’t be able to answer it immediately. How did you find the URL? Did you add any widgets in the “Displayed Everywhere” widget area?Best regards,
IsmaelMarch 15, 2016 at 10:53 am #598295Hi Ismael,
I guess I’m the one who should apologize, as I got too caught up in my impatient workflow. Which is why I went quiet :)
To answer your questions:
- I found the URL because my Yoast SEO XML Sitemap was 404ing;
- No, no widgets were added to the DE widget area.
Some more details:
Just to be sure, I ran a test on my test setup. It’s pretty much default. When only Enfold and Akismet are activated, the 404 page works perfectly fine. Once Yoast SEO comes into action, the XML 404 page gets into trouble. So I can confirm that there’s something about the Yoast SEO and Enfold combination.
Once Yoast SEO is deactivated, the XML 404 works fine again.
Here are the “Display Everywhere” widgets:
- Search
- Recent Posts
- Recent Comments
- Archives
- Categories
- Meta
Do you think it can be fixed via Enfold? Or is it Yoast SEO that needs to be fixed?
If Yoast SEO needs to be fixed, it’s probably best Kriesi contacts Yoast about the issue. As Kriesi has much more leverage than me.
Please let me know if you need more info.
Thanks,
Ralph
March 18, 2016 at 11:25 am #600205Hi!
Could you please provide a link where we can reproduce the issue? And post the login details here so that we can check the dashboard.
Regards,
IsmaelMarch 18, 2016 at 2:26 pm #600300Hi Ismael,
Thanks for your reply.
To answer your questions:
Please see the attached links to reproduce the issue. The PHP extension leads to the correct 404 page. The XML extension displays a 404 page, which displays the Pages widget for some reason.
Re the login details: Is their something specific you’d like to check in the dashboard? If yes, perhaps I can look that up for you myself. As I’ve learned the hard way, to never pass on login details :) Though my test setup uses default settings and Yoast SEO and Akismet are the only plugins within its plugin folder. Would you be able to re-create this setup on a WP test setup of your own?
Kind regards,
Ralph
March 22, 2016 at 10:09 am #601780Hi,
I thought you might want to know about the following: I just updated to Enfold v3.5.1 and, as you can see via the private links in my previous post, the 404 issue unfortunately persists.
Are there any updates from your side?
Best,
Ralph
March 23, 2016 at 12:36 pm #602478Hi,
I found out Yoast SEO is 100% to blame here, not Enfold.
The following Yoast SEO file contains a comment and function which explains everything:
wordpress-seo\inc\class-sitemaps.php
Here are the comment and function:
/** * Check the current request URI, if we can determine it's probably an XML sitemap, kill loading the widgets */ public function reduce_query_load() { if ( ! isset( $_SERVER['REQUEST_URI'] ) ) { return; } $request_uri = $_SERVER['REQUEST_URI']; $extension = substr( $request_uri, -4 ); if ( false !== stripos( $request_uri, 'sitemap' ) && ( in_array( $extension, array( '.xml', '.xsl' ) ) ) ) { remove_all_actions( 'widgets_init' ); } }
So, when an XML or XSL URI contains the word ‘sitemap’, the above function kills the (custom) widgets and ultimately forces Enfold to load its default/dummy widgets. Change or remove the word ‘sitemap’ in/from the XML URI and Enfold will show a 404 page with the custom / correct widgets.
Anyway, I’ll report the issue to Yoast SEO. Hopefully they’ll add a check to the above function, which checks whether the sitemap URI is actually a 404 page or not… before killing all widgets. That should fix the 404 page widgets issue.
Please consider leaving this topic open, so I can keep you guys posted about any replies from the Yoast SEO devs.
Thank you,
Ralph
March 24, 2016 at 2:12 pm #603050Hi,
Yoast developer input on the issue:
A Yoast dev explained that the Yoast SEO function, posted in my previous post, can’t check for a 404 page as the function’s ‘widgets_init’ is executed before the query. Please refer to this GitHub issue thread for more details: https://github.com/Yoast/wordpress-seo/issues/4214
Possible theme specific solution:
Would it be possible to have Enfold load any custom widgets, for a 404 page, before the Yoast SEO function has the chance to kill them? Enfold is already able to load its dummy widgets, before Yoast SEO can kill them. Perhaps this can also be done with any custom widgets?
If not, I’ll try to write a function that forces Enfold to always display custom widgets on a 404 page, instead of its dummy widgets.
Thanks,
Ralph
March 28, 2016 at 7:23 pm #604014Hey!
glad you could find the cause of the issue. Did you try to activate a default WordPress theme to check if you get the same or any different results? if you get the same result then we can’t do much unfortunately.
Best regards,
AndyMarch 30, 2016 at 12:16 pm #605104Hey,
It depends… if the theme doesn’t have some kind of fallback like Enfold (Enfold manages to fall back on its dummy widgets), then the theme will simply display no widgets at all. As the Yoast SEO function simply disables ‘widgets_init’ completely.
Anyway, since the conditions of the Yoast SEO function are already pretty tight (it is executed only when an XML URI actually has the word ‘sitemap’ in it), I figured I’m going to leave things as they are. As I think that writing a function that blocks Yoast SEO’s function when an XML URI is 404ing, won’t have much added value. I mean, when the Yoast SEO sitemap feature works correclty, I think the chances of having a user 404 an XML sitemap URI are really slim.
Thanks for pointing me in the direction of Yoast SEO! And please, feel free to consider the issue solved.
Thanks again,
Ralph
-
AuthorPosts
- The topic ‘XML page 404 displays default sidebar and footer widgets’ is closed to new replies.