Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author George Notaras

    (@gnotaras)

    Hi,

    You will have to add something like the following in a custom plugin or (possibly) in the functions.php file of the theme:

    function remove_amt_contactmethods( $contactmethods ) {
    
        if ( isset( $contactmethods['amt_twitter_author_username'] ) {
            unset( $contactmethods['amt_twitter_author_username'] );
        }
        // ... the same for other fields
    
        return $contactmethods;
    }
    add_filter( 'user_contactmethods', 'remove_amt_contactmethods' );

    The fields are:

    amt_twitter_author_username
    amt_twitter_publisher_username
    amt_googleplus_author_profile_url
    amt_googleplus_publisher_profile_url
    amt_facebook_author_profile_url
    amt_facebook_publisher_profile_url

    Please note that the publisher related fields will be removed from the user profile in 2.9.

    Kind Regards,
    George

    Thread Starter ernest_d

    (@sfedona)

    Nice !
    I would wait for next version then.

    Plugin Author George Notaras

    (@gnotaras)

    Please check v2.9.0 from which the publisher fields have been removed from the user profile pages.

    Feel free to post your feedback.

    George

    Thread Starter ernest_d

    (@sfedona)

    Well done arxige !

    Thread Starter ernest_d

    (@sfedona)

    In new created users these fields are not appearing indeed.
    But in previously created users there are still appearing.

    is there any way to delete them ?

    Plugin Author George Notaras

    (@gnotaras)

    Γεια σου φ?λε μου,

    I’m afraid I cannot reproduce this issue. User profile pages of new and old users only have the following fields activated:

    amt_twitter_author_username
    amt_googleplus_author_profile_url
    amt_facebook_author_profile_url

    All these fields are added to the user profiles as contact methods dynamically during plugin execution using code like the following:

    function add_amt_contactmethods( $contactmethods ) {
        // Add Facebook Author Profile URL contact method
        if ( !isset( $contactmethods['amt_facebook_author_profile_url'] ) ) {
            $contactmethods['amt_facebook_author_profile_url'] = __('Facebook author profile URL', 'add-meta-tags') . ' (AMT)';
        }
        return $contactmethods;
    }
    add_filter( 'user_contactmethods', 'add_amt_contactmethods' );

    So, I have really no explanation about why you are encountering this issue with old and new users. I’m out of ideas…

    Your feedback is welcome.

    George

    Thread Starter ernest_d

    (@sfedona)

    Doesn’t matter George,
    I suppose old custom fields are already being created in previous user profiles and they remain in WordPress database.

    The only way to remove them is to remove them from from MySQl with phpMyadmin.
    Xeritismata.

    Plugin Author George Notaras

    (@gnotaras)

    It is still possible to make them appear in the user profiles and delete their content, by adding the following code to functions.php

    add_filter( 'amt_allow_publisher_settings_in_user_profiles', 'amt_return_true' );

    Hope this helps. Otherwise, the deletion of the data directly from the db shell as you suggested is the only way.

    I intent to add some wp-cli actions so as to be able to manage this data more effortlessly.

    Χαιρετισμο??,
    Γι?ργο?

    Plugin Author George Notaras

    (@gnotaras)

    In general, the plugin does not force the removal of any data that has been added by the user, even if it is deactivated and deleted. The only data that is deleted is the plugin options.

    I had started writing a section about how to completely remove all data, but never found the time to extensively test the required queries in various WP setups before posting them in public.

    George

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Remove fields from user profile’ is closed to new replies.