PS4 Controller only works when plugged in

Firstly, if it is a third party manufactured controller that could happen. Notwithstanding the fact that the controller is wireless, you can manage playing games like the long old PS2 wire controller.

Secondly, some particular USB cable are not compatible with PS controllers just the way some USB cable are not compatible with some other devices such as phones, tablets and so on.

Lastly, if the battery of the controller is bad, it would have to be replaced because such issue you are experiencing may occur or worst.

Now there are couple of ways you can fix this problem. These ways are as follows:

  1. Plug your PS4 into your laptop or another device to charge it: Sometimes your controller may have problem charging with the console so try some other device to charge it to test it problem.

  2. Swap out the charging cable: The issue may not be with the controller itself but with the charging cable. Try a different cable or try using that cable to charge another controller.

You can also check the cable for physical signs of damage such as fraying on the cord or built-up grime in the plug.

  1. Check out the charging port: Built-up dust or grit may be interrupting the power flow and keeping your controller from charging. A quick pass with a wooden toothpick or compressed air may help.

  2. Reset and re-pair your controller: Go to the Settings menu on your PS4 and under "Devices," remove all devices from the list. Then, on your controller, press something into the small hole on the underside of the controller and hold it for five seconds. A toothpick or bobby pin, for example, may do the trick. Finally, re-sync the controller to the PS4 using the PS button.

  3. Conduct a power cycling on your PS4: Turn off your PS4 console and controller, and unplug the PS4's power cord from the outlet. Wait 5 to 10 minutes, and with the PS4 still unplugged, hold down the power button for 30 seconds to drain all its leftover energy. Then, plug the PS4 back in, turn it on, and see if the issue has been fixed.

If more info is needed, you can visit this website for help https://www.partitionwizard.com/partitionmagic/ps4-controller-not-charging.html