You can. But recipes do vary. In some cases, you can swap out all of the AP flour for whole wheat flour, in others only part of it.  I would suggest swapping out 1/2 to 2/3 of the whole amount to make sure it works.