FeedBurner subscription form failed to import

Home Forums Web Hosting Forum FeedBurner subscription form failed to import

This topic contains 1 reply, has 2 voices, and was last updated by  Keith Taylor 3 years, 9 months ago.

  • Author
  • #2666

    GoutPal Gout Support
    Ŧollars: Ŧ 0.48

    My website has transferred successfully to your shared WordPress hosting scheme. The only problem i can see so far is my FeedBurner subscription form on my About Page.

    Please can you enable the form for me

  • #2732

    Keith Taylor
    Ŧollars: Ŧ 1 ,191.16

    I’ve finally got round to sorting this out. Or, I think I’ve sorted it out. I’ll be testing the following fix on new WordPress Imports, to ensure it catches all problems.

    Please note that the following is quite technical. I don’t expect managed clients to know anything about the following explanation. I’m including it here, in case other visitors want to manage this problem on their own websites. Or, you could just ask me to manage it! 😉

    This failure to import forms is a restriction in WordPress. Even though the Import routine is run by a WordPress Administrator, the input is checked for potential problems. In this case, it’s triggered by the HTML <form> tag. Other problem tags include <iframe> and <embed>.

    I intended trying to find a definitive list. Then, I could search for these, and manually correct them post-import. However, this could get tedious on some websites. What is really required is to stop the Import process filtering out content that has already been accepted.

    The problem lies in a process triggered by wp_filter_post_kses. There is a common ‘solution’ commonly offered to overcome this. Many suggest that the problem can be resolved by hacking the WordPress core file, wp-includes/kses.php:

    #add_filter('content_save_pre', 'wp_filter_post_kses');
    #add_filter('excerpt_save_pre', 'wp_filter_post_kses');
    #add_filter('content_filtered_save_pre', 'wp_filter_post_kses');

    That suggestion is to put # at the beginning of the lines to turn them into comments. Hacking WordPress core is never a good idea. It should definitely not be required in this case. The kses function is made active with add_filter. So, the obvious answer is to cancel that in functions.php, using remove_filter

    Now, the main problem with remove_filter is knowing where to apply it. If you try to remove the kses filter before it is applied, your removal will fail. In this case, the solution is easy.

    We can see from the way that wp_filter_post_kses is called, there is no priority assigned. So, the WordPress default priority of 10 will be applied. All we have to do is specify a higher number for our remove_filter call. Not that higher number = lower priority. To be precise:

    Lower numbers correspond with earlier execution, and functions with the same priority are executed in the order in which they were added to the filter.

    The final result is:

    function kct_disable_kses() {
        add_filter('content_save_pre', 'wp_filter_post_kses');
        add_filter('excerpt_save_pre', 'wp_filter_post_kses');
        add_filter('content_filtered_save_pre', 'wp_filter_post_kses');

    Note that, once you’ve Imported your WordPress content, you should disable this little snippet.

You must be logged in to reply to this topic.