If the speakers came with plugs (e.g. many KEF models) they are designed to be plugged so that the sound will be more balanced when you place them closer to the wall. The KEF LS50 for example has three modes- open port, half plugged and fully plugged. The manual specifies the best position from the wall for each mode. More plugged = closer to wall.
However many ported speakers are not designed to have them plugged. Woofer suspensions are such that they can be designed for stiffness / wide open port, hybrid stiffness where they can be both ported and plugged, or very loose suspensions that require them to be sealed.
First step is to consult your manual to see how close they recommend placing them. You can always experiment by plugging the ports. I tried it once with speakers not designed to be plugged and it ruined the whole sound and distorted the midrange.