Tagged: 

Viewing 17 posts - 1 through 17 (of 17 total)
  • Author
    Posts
  • #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

    #593879

    Hi,

    Does anyone know how the solve the 404 page issue described in my previous post?

    Thank you,

    Ralph

    #593926

    Hey!

    do you have any plugin like Yoast SEO or something like that activated?

    Cheers!
    Basilis

    #593931

    Yup, 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?

    #594530

    Hey,

    Does anyone know why Yoast SEO might be causing the issue? And whether it can be solved without deactivating Yoast SEO?

    Thanks,

    Ralph

    #594978

    Hello?

    #595414

    Hey,

    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

    #596190

    Hey 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

    #598185

    Hi!

    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’t won’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,
    Ismael

    #598295

    Hi 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

    #600205

    Hi!

    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,
    Ismael

    #600300

    Hi 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

    #601780

    Hi,

    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

    #602478

    Hi,

    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

    #603050

    Hi,

    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

    #604014

    Hey!

    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,
    Andy

    #605104

    Hey,

    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

Viewing 17 posts - 1 through 17 (of 17 total)
  • The topic ‘XML page 404 displays default sidebar and footer widgets’ is closed to new replies.