Remove mapping to facebook account

I am doing some testing and I need to remove all the account associations with facebook accounts so I can start again.

Is there an option to remove it or do I have to do something in the database?

  • Predrag Dubajic

    Hey @Mike,

    Hope you're doing well today :slight_smile:

    Here is something that should work but please before trying anything make sure you have full backup ready just in case something goes wrong.

    What you need to do is access your WP installation via FTP and in your theme functions.php file paste this code:

    add_action('wp_loaded','uninstall_ufacebook');
    function uninstall_ufacebook(){
    	global $wpdb;
    //Network_options
    	$wdfb_option_keys = array(
    		'wdfb_api',
    		'wdfb_autopost',
    		'wdfb_widget_pack',
    		'wdfb_opengraph',
    		'wdfb_comments',
    		'wdfb_grant',
    		'wdfb_connect',
    		'widget_wdfb_widgetactivityfeed',
    		'widget_wdfb_widgetalbums',
    		'widget_wdfb_widgetconnect',
    		'widget_wdfb_widgetevents',
    		'widget_wdfb_widgetfacepile',
    		'widget_wdfb_widgetlikebox',
    		'widget_wdfb_widgetrecentcomments',
    		'widget_wdfb_widgetrecommendations',
    		'wdfb_button',
    		'wdfb_groups',
    		'wdfb_error_log',
    		'wdfb_notice_log'
    	);
    //Delete options
    	foreach ( $wdfb_option_keys as $key ) {
    		if ( is_multisite() ) {
    			global $wpdb;
    			$blogs = $wpdb->get_results( "SELECT blog_id FROM {$wpdb->blogs}", ARRAY_A );
    			if ( $blogs ) {
    				foreach ( $blogs as $blog ) {
    					switch_to_blog( $blog['blog_id'] );
    					delete_site_option( $key );
    				}
    				restore_current_blog();
    			}
    		} else {
    			delete_option( $key );
    		}
    	}
    //delete from site meta
    
    //Remove Cron Job
    	wp_clear_scheduled_hook( 'wdfb_import_comments' );
    }

    Go to or refresh your site, go back to functions.php remove the code and that should be it.

    Let us know how it goes.

    Best regards,
    Predrag

  • Adam Czajczyk

    Hey Mike,

    I hope you're doing fine today. May I hop into this conversation for a moment?

    Facebook permissions isn't something you can change via FB developers console. There are two possible scenarios:

    1. You're the user of an app.

    In this case you can do nothing except remove authorization for an app.

    2. You're the developer.

    To request additional permissions from a user you need to add a request to your app's code so it would ask users to re-authorize. If you need a completely "clean start" for development, simply go to

    https://developers.facebook.com

    and select your app from "My Apps" dropdown menu. Go to "Settings' and scroll down a bit - there's a red "Delete App" button. Delete the app and create a new one.

    I hope that helps!

    Cheers,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.