It isn't safe to use expired heartworm medication or any other type of expired medication for dogs. The insecticide used to kill heartworms--in many cases, milbemycin oxime--might not be effective after the expiration date.
The American Heartworm Society recommends that any expired heartworm medication for dogs and cats be thrown out and new medicine be administered to best protect pets from heartworms.
According to The Pet Center, the expiration date on all dog medications is the date after which the product can no longer be legally sold, but heartworm medication can still be used in the first few months after that date.
If you begin using a package of one-dose-a-month heartworm medication and realize the expiration date will occur before you'll have used it all, it's OK to use the entire package, according to The Pet Center. Manufacturers take into account how long it takes to use the product when deciding the expiration date, and the medication can still be used in the remaining months after that date.
Always check the expiration date of the heartworm medication before purchasing to be sure the medicine will not expire before all of the tablets can be used. Some stores might not remove medication from the shelves promptly enough.
Heartworm medication only kills immature heartworms in the bloodstream, but not adult heartworms. "The Pill Book Guide to Medication for Your Dog and Cat" warns that all dogs need to be tested for adult heartworms before being given any heartworm drugs.