Typically if you lock yourself out on WordPress side the easiest approach is to edit/delete code responsible.
Often this is just FTP or something and whacking it. In more elaborate setups you might not have access and get the person with such to take care of it.