Optimal coherent control of many qubits is critical to quantum information processing. Here, an efficient scheme is proposed for implementing state swap and creating an entanglement with two superconducting qubits in a circuit quantum electrodynamics (QED). Two qutrits of Cooper‐pair box (CPB) circuits are placed into a cavity field and are driven by individual classical microwaves. In the two‐photon resonance with a large detuning, each CPB is reduced into a qubit effectively. Within a composite system composed of qubit states and cavity photons, two‐qubit state swap and entanglement can be fast obtained using the technique of shortcuts to adiabaticity with counterdiabatic drivings. Benefited from the shorter duration times and less sensitivity to timing errors and parameter imperfections, high‐fidelity quantum operations can be performed with the accessible decoherence rates. The present protocol could offer a feasible route towards optimized operations on superconducting qubits in a circuit QED.