How to Block a Sender in Yahoo! IM
open your Yahoo! Messenger program and sign in. Delete the Yahoo! ID of the person you would like to ignore from your contact list by right-clicking on the name and navigating to "Delete." Click "OK."
Available for users only
Click on "Ignore Anyone Who Is Not in My Messenger List" in the ignore list preferences screen and hit "OK" to ignore anyone who is not in your contacts list. You will appear offline to everyone except those in your contacts list