How would go about if I just want a temporary function?

Use e.g. the init hook instead. For instance;:

if (isset($_GET['convert'])) add_action('init', 'yourfunction');

(Come up with a better check, though. ?convert could mean anything. And secure it by checking for user permissions, that it hasn’t already run, etc.)