WordPress.org

Ready to get started?Download WordPress

Forums

HTML Import 2
[resolved] Add All In One Seo Pack Title, Description, Keywords (2 posts)

  1. ffwebdesigner
    Member
    Posted 3 months ago #

    Hi Stephanie,

    first of all: thanks a lot for your brilliant plugin! Love it, saves ages in transferring large company websites.

    Only thing I was missing: correct import of meta tags: Title, Description, Keywords.

    I'm using the most popular All In One SEO Pack plugin. To fill the custom fields importing static html pages, do the following:

    First, title: easy. go to HTML import 2 settings, custom fields. Add field. Custom field name: _aioseop_title. Tag: title.

    Second: Meta description and keywords: I had to hack your plugin a little, as the custom fields of your plugin unfortunately can't catch meta name="keywords" etc.

    I'm using HTML import 2. Open html-importer.php.
    Line 569, after

    $my_post['post_excerpt'] = (string)$my_post['post_excerpt'];

    add

    // mod ff description und keywords importieren
    $my_post['_aioseop_keywords'] = $xml->xpath('//meta[@name="keywords"]');
    if (isset($my_post['_aioseop_keywords'][0]))
    $my_post['_aioseop_keywords'] = $my_post['_aioseop_keywords'][0]['content'];
    if (is_array($my_post['_aioseop_keywords']))$my_post['_aioseop_keywords'] = implode('',$my_post['_aioseop_keywords']);
    $my_post['_aioseop_keywords'] = (string)$my_post['_aioseop_keywords'];
    $my_post['_aioseop_description']=xml->xpath('//meta[@name="description"]');
    if (isset($my_post['_aioseop_description'][0]))			$my_post['_aioseop_description'] = $my_post['_aioseop_description'][0]['content'];
    if(is_array($my_post['_aioseop_description']))$my_post['_aioseop_description'] = implode('',$my_post['_aioseop_description']);
    $my_post['_aioseop_description'] = (string)$my_post['_aioseop_description'];

    then little further down after

    add_post_meta($post_id, $fieldname, $fieldvalue, true);
    			}
    		}

    add

    add_post_meta($post_id, '_aioseop_keywords', $my_post['_aioseop_keywords'], false);
    add_post_meta($post_id, '_aioseop_description', $my_post['_aioseop_description'], false);

    worth integrating in the next version?

    cheers
    frank

    https://wordpress.org/plugins/import-html-pages/

  2. Stephanie Leary
    Member
    Plugin Author

    Posted 3 months ago #

    Maybe! I'm trying to balance the already-insane number of options with support for other plugins. This might be a single checkbox, though. I'll definitely consider it. Thanks!

Reply

You must log in to post.

About this Plugin

About this Topic