[Moto G4 Plus Guides, News, & Discussion] echo92:
Sounds like you could do with a clean flash of the stock/near stock ROM to clean your system - this shouldn't be an issue as you've mentioned doing a factory reset (which should have wiped your data/cache/Dalvik), so your device should be nearly clean apart from having files on internal storage/SD card. I'm not sure what - if anything - happened to your root when the factory reset was performed, but from your description it's causing issues. Can we get some more information on the rooting procedure you followed please, and what OS/TWRP/SuperSU/ElementalX versions you have, and also what device (I'm guessing an XT1643)?

Firstly, are you still able to boot to recovery? Perhaps you can try by turning your device off, then hold down the power and volume down keys together. That should allow you to boot into your bootloader, then select the recovery (with the volume keys) and the power button to boot into recovery.

If you can boot into TWRP, I'd suggest backing up your data off your internal storage to your SD card or to your computer - plugging your device into your computer should make your internal storage accessible if you're in TWRP. As an aside, you may wish to jump to steps 3 or 4 if you want to ensure a stable system.

1) Once you've backed up your essential files, try re-flashing ElementalX v1.04 stock on your device. Once flashed, wipe cache and Dalvik, then reboot. See if that gets your system booting (as an aside, what SuperSU version are you using? Ideally, you'll want either SuperSU 2.79 SR3 beta or 2.82 or above).

1a) If ElementalX doesn't boot, you may wish to flash a clean stock kernel onto your device via TWRP. Bear in mind I do not know if this works if you've not properly unrooted, but a stock clean kernel should have no root modifications. That may allow your system to boot if the rooting didn't work completely (though any root managers obviously will fail to function on booting). https://xdaforums.com/showpost.php?p=72378739&postcount=262 for links to stock kernels and how to flash them.

2)If that doesn't work, did you take a TWRP backup of your system before flashing ElementalX (as directed in the guide)? Provided you didn't wipe your internal storage with the factory reset, restore your previous backup. Boot into your backup and verify it's working (also verify what kernel you have).

3)If you didn't make a backup prior to flashing, or it was wiped, then you may be able to flash a TWRP version of your system, which should help it to boot. This shouldn't affect your internal storage (though you've backed up your files!). https://xdaforums.com/moto-g4-plus/how-to/fxz-flashable-stock-npjs25-93-14-4-t3623010 for a TWRP flashable zip of the NPJS25.93-14.4 ROM (thanks to Q9Nap and DroidPhilev). If you've got an earlier Nougat ROM, let us know/have a look in the Guides section for an earlier TWRP flashable ROM. You may wish to flash a TWRP flashable ROM anyway to ensure your system is stable, then proceed to attempt rooting from that point. The TWRP flashable should be near what you had originally prior to rooting with ElementalX.

4)Ah, the fail-safe option - if you really can't boot into your recovery, or if you really want to make sure that you have a clean slate to work from, then you can re-flash the Motorola stock ROM. Of course, this will wipe your device (including internal storage) and remove TWRP and root from your device, replacing the kernel and recovery with stock versions. Unfortunately, if you couldn't boot into recovery, I don't know if there's a way to rescue your files from your internal storage...

You do not have to re-lock your device and if you're flashing the same firmware version, you don't have to flash the GPT or bootloader partitions either. Thus, the fastboot commands below can be used in lieu:

fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash dsp adspso.bin
fastboot flash oem oem.img
fastboot flash system system.img_sparsechunk.0
fastboot flash system system.img_sparsechunk.1
fastboot flash system system.img_sparsechunk.2
fastboot flash system system.img_sparsechunk.3
fastboot flash system system.img_sparsechunk.4
fastboot flash system system.img_sparsechunk.5
fastboot flash system system.img_sparsechunk.6
fastboot flash system system.img_sparsechunk.7
fastboot flash modem NON-HLOS.bin
fastboot erase modemst1
fastboot erase modemst2
fastboot flash fsg fsg.mbn
fastboot erase cache
fastboot erase userdata
fastboot erase customize (optional: will erase any customizations if ordered through motomaker)
fastboot erase clogo (optional: will erase the custom boot logo if ordered through motomaker)
fastboot reboot

March 2017 fastboot ROM (NPJS25.93-14.4): https://xdaforums.com/moto-g4-plus/how-to/stock-rom-npjs25-93-14-4-march-1-t3608138

Dec 2016 fastboot ROM (NPJ25.93-14):https://xdaforums.com/moto-g4-plus/how-to/moto-g4-plus-xt1640-43-athene-npj25-93-t3549369

Good luck whatever you try :)