We propose a bidding method for the participation of combined heat and power (CHP) units in the day-ahead electricity market. More specifically, we consider a district heating system where heat can be produced by CHP units or heat-only units, e.g., gas or wood chip boilers. We use a mixed-integer linear program to determine the optimal operation of the portfolio of production units and storages on a daily basis. Based on the optimal production of subsets of units, we can derive the bidding prices and amounts of electricity offered by the CHP units for the day-ahead market. The novelty about our approach is that the prices are derived by iteratively replacing the production of heat-only units through CHP production. This results in an algorithm with a robust bidding strategy that does not increase the system costs even if the bids are not won. We analyze our method on a small realistic test case to illustrate our method and compare it with other bidding strategies from literature, which consider CHP units individually. The analysis shows that considering a portfolio of units in a district heating system and determining bids based on replacement of heat production of other units leads to better results.