Before beginning, verify that your device is currently running the application's latest version.
Android: Open the PlayStore > My Apps > Installed > WhatsApp Messenger > Update.
iOS: Open the iTunes App Store > Updates. Here, you'll find all the information pertaining to the version of WhatsApp installed on your device.
Allow WhatsApp to Access Your Address Book
Next, you'll need to make sure that WhatsApp has the necessary permissions to access your address book.
Android: Go to Apps > Settings > Security > Permissions > Contacts and grant the necessary permissions to WhatsApp Messenger. If your smartphone doesn't provide a built-in option for managing app permissions, you can use a free app such as Permission Manager to overcome this limitation.
iOS: Go to Settings > Privacy > Contacts and toggle the switch displayed next to WhatsApp Messenger to On.
Unhide Hidden Contacts Groups in Address Book
If the problem still persists, then you'll need to verify whether the missing contacts are part of a hidden contact group and unhide them.
Android: Open the Contacts app > Settings > Contact to Display > All.
iOS: Open Contacts > Groups and check for hidden contact groups.
Show All Contacts in WhatsApp
Open WhatsApp > Settings > Contacts and then tick the Show All Contacts checkbox. WhatsApp will now display all your contacts, including the offline contacts.