Numerical simulations and finite-size scaling analysis have been carried out to study standard and inverse bond percolation of straight rigid rods on square lattices. In the case of standard percolation, the lattice is initially empty. Then, linear bond k-mers (sets of k linear nearest-neighbor bonds) are randomly and sequentially deposited on the lattice. Jamming coverage p_{j,k} and percolation threshold p_{c,k} are determined for a wide range of k (1≤k≤120). p_{j,k} and p_{c,k} exhibit a decreasing behavior with increasing k, p_{j,k→∞}=0.7476(1) and p_{c,k→∞}=0.0033(9) being the limit values for large k-mer sizes. p_{j,k} is always greater than p_{c,k}, and consequently, the percolation phase transition occurs for all values of k. In the case of inverse percolation, the process starts with an initial configuration where all lattice bonds are occupied and, given that periodic boundary conditions are used, the opposite sides of the lattice are connected by nearest-neighbor occupied bonds. Then, the system is diluted by randomly removing linear bond k-mers from the lattice. The central idea here is based on finding the maximum concentration of occupied bonds (minimum concentration of empty bonds) for which connectivity disappears. This particular value of concentration is called the inverse percolation threshold p_{c,k}^{i}, and determines a geometrical phase transition in the system. On the other hand, the inverse jamming coverage p_{j,k}^{i} is the coverage of the limit state, in which no more objects can be removed from the lattice due to the absence of linear clusters of nearest-neighbor bonds of appropriate size. It is easy to understand that p_{j,k}^{i}=1-p_{j,k}. The obtained results for p_{c,k}^{i} show that the inverse percolation threshold is a decreasing function of k in the range 1≤k≤18. For k>18, all jammed configurations are percolating states, and consequently, there is no nonpercolating phase. In other words, the lattice remains connected even when the highest allowed concentration of removed bonds p_{j,k}^{i} is reached. In terms of network attacks, this striking behavior indicates that random attacks on single nodes (k=1) are much more effective than correlated attacks on groups of close nodes (large k's). Finally, the accurate determination of critical exponents reveals that standard and inverse bond percolation models on square lattices belong to the same universality class as the random percolation, regardless of the size k considered.