WASHINGTON (AP) _ Publisher Rupert Murdoch likely will have to sell the New York Post and the Boston Herald next year because of an amendment slipped through Congress in the final moments of this year's session.

The language, tucked into a $600 billion spending bill for fiscal 1988, prevents the Federal Communications Commission from repealing or modifying its newspaper-television cross-ownership rule, or from extending any current waivers.

Murdoch has the only outstanding waiver of the rule. The FCC has given him until March 1988 to sell the Post and June 1988 to sell the Herald.

The media magnate had been expected to seek a delay in the Post deadline to give him more time to sell the financially strapped newspaper.

In a statement Wednesday night, Murdoch said: ''We have been actively seeking buyers for the Post for several weeks and are currently in negotiations. No decisions have been reached about Boston.''

The cross-ownership rule prohibits anyone from owning a radio or TV station and a daily newspaper that serve the same geographic area. The language in the spending bill, however, refers only to TV stations.

In March 1986, Murdoch bought Metromedia and changed its name to Fox Broadcasting, which owns WNYW, Channel 5, in New York and other stations nationwide. The FCC granted him a two-year waiver of the cross-ownershi p rule to give him time to sell the Post.

Murdoch bought a Boston UHF station, then WXNE-TV and now WFXT-TV, Channel 25, from Christian Broadcasting Network in December 1986. The FCC gave him 18 months to sell the Herald to comply with the cross-ownership rule.

The FCC has been considering a petition that it scrap the rule on the grounds that it is constitutionally suspect and that it no longer is needed because of the proliferation of broadcast stations.

The Freedom of Expression Foundation, a media-funded research group which filed the petition, said the rule actually is exacerbating the decline in the number of daily newspapers in the country.

Foundation President Craig Smith has said the petition was not intended to help Murdoch. But if the FCC moved to a rule-making proceeding on the petition, Murdoch could be granted a delay in the required sales until a decision was made.

The FCC has asked only for comment on the petition, and the congressional action will stop the agency there.

Comments were due Wednesday, and among the groups that filed in spite of the congressional directive were the National Association of Broadcasters and the American Newspaper Publishers Association, both of which opposed the rule when the FCC adopted it in 1975 and still oppose it.

Murdoch's News America Corp. intended to file comments, company spokesman Peter Rosenthal said, but he declined to characterize Murdoch's position on the issue and would not comment on the congressional action.

It could not be determined who asked that the provision be added to the spending package.

Sen. Daniel K. Inouye, D-Hawaii, and Sen. Ernest F. Hollings, D-S.C., introduced a broadcasting bill earlier this year that would prevent the FCC from repealing or altering the rule.

An aide to Inouye who asked not to be identified by name said the provision was one of several ''that stemmed from existing concerns Congress had about proposed or ongoing rulemakings at the FCC.'' The aide said Inouye did not author the provision.