Add a link to unflag all node By default, it just available to flag or unflag an item, reference here. I want to add a link to unflag all flagged node of current user, is there any way to do that?

At this moment, I get the code to clean all flagged node, but I don't know how to make this snippet as a link

db_query("DELETE FROM {flag_content} WHERE sid = %d", flag_get_sid());
Create a custom module that implements hook_menu().  Use that to create a path and a custom callback function that will run your query.  Something like:

/**
 * Implementation of hook_menu()
 */
function MYMODULE_menu() {
  $items = array();

  $items['flags/remove/%user'] = array(
    'page callback' =&gt; 'MYMODULE_remove_flags',
    'page arguments' =&gt; array(2),
    'access callback' =&gt; 'MYMODULE_check_access',
    'access arguments' =&gt; array(2),
    'type' =&gt; MENU_CALLBACK,
  );

  return $items;
}

// Adding custom functions, etc


To get started on creating a custom module, the Module developer's guide