Custom fields not saved by Wordpress
  • Hello,

    I'm trying to troubleshoot an issue that I am having when posting to Wordpress using ME. I have installed "All in One SEO" and added three custom fields to the ME blog settings: _aioseop_title, _aioseop_description, _aioseop_keywords.

    After I publish a new post to WP with the aforementioned custom fields filled out, two things happen:

    1. The custom fields don't appear in WP
    2. If I double-click the post just published, the custom fields that I populated only a couple of minutes before are empty.

    One thing that I have noticed is that if I fill out those fields from the WP web interface and sync the blog in ME, the custom fields content becomes visible in ME. It looks like as if ME has a problem communicating with WP.

    Looking at the Network Log in ME I can see that:

    - The custom fields are being sent to WP:

    key
    _aioseop_title


    value
    Bla bla bla

    ...

    - Looking at the server response, I can't see any reference to thee custom fields at all.

    Some additional information
    - The "All in One SEO" is enabled in WP
    - I have also reproduced the same behavior with "Yoast SEO plugin" which would suggest that the issue is not with the plugin itself.

    I am not 100% sure that this is an ME issue at this point. I am trying to narrow the problem down somehow. Maybe the problem is simpler than I think... Any help appreciated.

    Best regards,
    Ricky
  • Hi Ricky - I haven't set up MarsEdit to integrate with AIO SEO myself, but there is a rather extensive write-up from Jorge Ledesma:

    http://www.jorgeledesma.net/notebook/marsedit-seo

    Would you mind taking a look at that and see if it brings to light any difference in how you're approaching the problem versus how he solved it?

    Daniel
  • I have had this working great for the last year or so. All of a sudden, with the last WordPress update, it stopped working. Frustrating. I am not sure if this is something you can fix or not, but it would be great if you could! Thanks.
  • Michael, can you give me some more details about how it stopped working? Did the values you set in MarsEdit stop showing up in WordPress? It would be useful to examine the network log to see if the value is being sent by MarsEdit to the server, and then if it's in the response when MarsEdit downloads the post again.
  • Yes, exactly. Even though I set the values in MarsEdit, they don't translate to WordPress. In fact, after it sends, the values in MarsEdit are blank.

    I am not sure how to get to the network log. If you can tell me how, I will try. Thanks.
  • Michael, it will probably be easier for me to process the network log info via email.

    1. Open MarsEdit
    2. Select Window -> Network Log from the menu bar.
    3. Clear the log if it's not already empty.
    4. Try to write a post with custom field values, and send it to the blog.
    5. Copy the network log contents, and paste into an email to me: support@red-sweater.com.

    What this will do is show the complete interaction between MarsEdit and your blog, and confirm whether the custom fields are being stripped by MarsEdit or by the blog itself.

    By the way, any changes in your blog setup e.g. themes or plugins, that may be playing a role in addition to the update of WordPress version?

    Daniel
  • I'll do this tomorrow evening (Sunday) and report back. Thanks.
  • I just emailed you the Network Log.

    With regard to new plugins, I added bib.ly last week.

    Thanks.
  • Thanks, Michael. I have pinpointed the problem to some changes that were made to WordPress for their 3.1.3 update. Currently the great developers at WordPress looking into this and hopefully they'll come up with a solution that will fix it in an update to WordPress, or at least have advice for how the plugin developers should change their handling of custom fields.
  • For anybody who is comfortable editing their WordPress source code, here's a temporary fix for the AIO SEO fields in particular, that essentially whitelists those fields in the security check that WordPress 3.1.3 added. A similar approach could be used for any other naming convention where the prefix is the same e.g. as the "_aiseop" example in this scenario.

    Index: meta.php
    ===================================================================
    --- meta.php (revision 18320)
    +++ meta.php (working copy)
    @@ -588,7 +588,7 @@
    * @return bool True if the key is protected, false otherwise.
    */
    function is_protected_meta( $meta_key, $meta_type = null ) {
    - $protected = ( '_' == $meta_key[0] );
    + $protected = (( '_' == $meta_key[0] ) && ( strpos($meta_key, "_aioseop") !== 0));

    return apply_filters( 'is_protected_meta', $protected, $meta_key, $meta_type );
    }
  • Hi Daniel & Michael,

    Thanks a lot for picking up where I left and continue the troubleshooting.

    I temporarily put it aside due to some other urgent business with my real job but I'd like to thank you for working on this. I'll test the temporary solution ASAP.

    Best regards,
    Ricky
  • Thanks, Daniel. This is one of the many reasons I love MarsEdit—your active engagement with your customers. Kudos to you!
  • Oops - I just realized I had a typo in the example. Michael, I'll follow up with your tech partner. Macography, make sure you tweak it in such a way that the value in quotes is "_aioseop" … it was inadvertently "_aiseop" before.
  • It worked! I posted last night after Andrew made the changes to the WordPress files. Thanks for your help!
  • Excellent. Just tested it now and the solution works like a charm. For whoever is using Yoast SEO plugin, the fields to whitelist have a prefix _yoast_wpseo_

    Much appreciated Daniel and Michael.

    Ricky
  • Thank you for this info Daniel. Just what I needed for Yoast! Tested it and it downloaded and uploaded to my blog. Here are the Yoast wp SEO info for the custom fields:

    '_yoast_wpseo_focuskw', 'Yoast Focus Keyword only used to evaluate SEO'

    These are the three that you will find in the "head" of your web pages.

    '_yoast_wpseo_title', 'Yoast SEO Title'
    '_yoast_wpseo_metadesc', 'Yoast meta description'
    '_yoast_wpseo_metakeywords', 'Yoast Meta Keywords'

    I hope this helps someone else.
  • Great! Thanks for the additional info, OmniUnique!
  • I'm using wordpress, marsedit, and wordpress seo by yoast and I entered the data according to OmniUnique's suggestions and I can not get it to work. Am I supposed to include the '? I.e. should it be '_yoast_wpseo_title' or _yoast_wpseo_title? Also, this is the server custom field name, correct?
    What I expect is that I open a new post in mars edit and enter the custom fields information. Then post to web. Then when I go to the WP admin panel to the post and look at the seo data under the post, the custom fields information will be in the parallel fields there too. But I cannot get that to happen. Any help will be appreciate.
    thank you,
    Duke
  • Note, I read Macography's post on this. I did not understand before that I need to go in and edit the meta.php file. Is that correct?
    If so, I'm using standard3 theme in which they make use of a childtheme. Can I copy the meta.php file to the child theme and do it there or is it different, i.e. part of WP and not part of the theme?
    thanks,
    Duke
  • Anybody out there?
  • Hi dukedillard - sorry about the delay. I try to keep up on the forums but sometimes they slip my mind for a few days :)

    I am not completely up to date on the current state of Yoast's SEO plugin. Are you using the very latest release of their plugin? I know that WordPress made some changes that caused custom fields with _ prefixes to be ignored unless a plugin developer takes care to let WordPress know they should be editable. If you have the server custom field names verbatim in MarsEdit, then they should be writing successfully to the blog. As far as whether the question mark should be in a field name that just depends on literally whether the plugin includes a question mark when writing/reading to that field.

    Please let me know if you are using the very latest version of Yoast. If not, please update it to the latest and let me know if you are still running into the problem. Thanks!

    Daniel
  • Yes, Daniel, I am using version 1.2.5 which is the latest version as far as I can tell.
    And I would not be surprised if it works but I am doing something wrong.
    I have not updated the meta.php file. If I have to, I need to know that.
    Also, I experimented and did the following:
    For Yoast SEO Title I put this for server custom field name: '_yoast_wpseo_title'
    Then for the yoast focus keyword I put this: _yoast_wpseo_focuskw
    When I post to the web, and go check in admin and look at the SEO data, it is all blank.
    But when I reopen the post to edit in Marsedit, the seo title still has what I typed but the keyword field is blank.
    I'm not sure what that means.
    thank you
  • I looked up on the website and it did not include the yoast part of the custom title so I took that out. Now it does not erase it from the post after it goes to the web but it also does not show up on the wp-admin post page when I look at the SEO information. So, I do not know what that means?
  • One of the problems here is because I haven't personally used the Yoast plugin, I'm not familiar with all the ins and outs of configuring it. I don't even know for example what it means to update the meta.php file. I would love to help confirm and ensure that MarsEdit is doing its part of getting custom fields written to the blog. Apart from that, I'm afraid that working out the functionality of the plugin might be something to follow up with Yoast about.

    One "sanity check" you could do is to just add your own custom field in MarsEdit, name it something like "test_field" as the server name. When you publish a post to WordPress with this "test_field" on the post, it should show up in the admin panel, under the Custom Fields for the post. (You may have to select custom fields from "Screen Options" at the top right of the screen).

    Based on what you said about the _yoast_wpseo_title field being blanked there but the _yoast_wpseo_focuskw field being blank, it makes me wonder if the plugin has an issue where it isn't properly register the _yoast_wpseo_focuskw field with WordPress as an editable field. But again, this is probably something you will have to follow up with Yoast about if we can't figure out something superficially wrong.

    Daniel
Start a New Discussion

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!