its easy. just connect a keyboard to your ps4 and go to settings and then go to bluetooth devices. now forget all devices and then you can manually pair your controller to your ps4 by holding your ps button and share button.
When I'm connecting my controller with the usb port of my ps4 it is not charging but my controller is turning on. Although its not getting charged. It seems like a plug n play thing. Please help me with this issue.