$schemamarkup = get_post_meta(get_the_ID(), 'schemamarkup', true); if(!empty($schemamarkup)) { echo $schemamarkup; }

Fix Nicepage Duplicate Opengraph Tags with SEO Plugin

August 11, 2024 | By the+gnu+linux+evangelist.

Solving Nicepage Duplicate Opengraph Tags with SEO Plugin in Linux

Hi! This Tip Try to Solve WordPress Nicepage Duplicate Opengraph Tags with SEO Plugin in GNU/Linux.

Especially relevant: this is only a Manual Dirty Fix that need to be remade after each NicePage Update!

Fix Nicepage Duplicate Opengraph Tags with SEO Plugin
  1. 1. Fixing NicePage Plugin

    Then to Solve MYISSUE in Linux
    First, change to the target:

    cd [SITEROOT]/wp-content/plugins/nicepage
    

    Possibly first make a Backup of the Plugin for semplicity in wp-content:

    cp -r ../nicepage ../..
    

    Now Edit the functions.php File with nano editor:

    nano functions.php
    

    Search for “property=”:
    Ctrl+w for Searching in nano.
    And Change the Block:

    if ($is_np) { ?>
        <meta property="og:title" content="<?php echo esc_attr($title); ?>"/>
        <meta property="og:url" content="<?php echo esc_attr($url); ?>"/>
        <meta property="og:description" content="<?php echo esc_attr($description); ?>"/>
        <?php if (isset($image)) { ?>
            <meta property="og:image" content="<?php echo esc_attr($image); ?>"/>
        <?php } ?>
    <?php } else { ?>
        <meta property="og:type" content="<?php echo $type; ?>"/>
        <meta property="og:site_name" content="<?php echo get_bloginfo('name'); ?>"/>
        <meta property="og:title" content="<?php echo esc_attr($title); ?>"/>
        <meta property="og:url" content="<?php echo esc_attr($url); ?>"/>
        <meta property="og:description" content="<?php echo esc_attr($description); ?>"/>
    <?php } ?>
    

    In:

    ?>
    

    Finally, Ctrl+x to Save & Exit from nano Editor.
    In case of Error in the process just restore the NicePage copy!